webim-adapter 0.29.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/webim-adapter.js +1675 -744
- package/build/webim-embed.js +13 -11
- package/build/webim-ssr.js +1652 -723
- package/package.json +1 -1
package/build/webim-ssr.js
CHANGED
|
@@ -13,7 +13,43 @@ var p = /* @__PURE__ */ new Set([
|
|
|
13
13
|
"yi",
|
|
14
14
|
"dv",
|
|
15
15
|
"ckb"
|
|
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, g =
|
|
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, g = [
|
|
17
|
+
"linear",
|
|
18
|
+
"ease",
|
|
19
|
+
"ease-in",
|
|
20
|
+
"ease-out",
|
|
21
|
+
"ease-in-out"
|
|
22
|
+
], _ = (e) => {
|
|
23
|
+
let t = String(e ?? "").trim();
|
|
24
|
+
if (!t) return null;
|
|
25
|
+
let n = Number(t);
|
|
26
|
+
return Number.isFinite(n) ? n : null;
|
|
27
|
+
};
|
|
28
|
+
function v(e) {
|
|
29
|
+
let t = [], n = [], r = _(e?.opacity), i = _(e?.x), a = _(e?.y), o = _(e?.scale), s = _(e?.rotate), c = _(e?.blur);
|
|
30
|
+
return r !== null && t.push(`opacity: ${r}`), i !== null && n.push(`translateX(${i}px)`), a !== null && n.push(`translateY(${a}px)`), o !== null && n.push(`scale(${o})`), s !== null && n.push(`rotate(${s}deg)`), n.length && t.push(`transform: ${n.join(" ")}`), c !== null && t.push(`filter: blur(${c}px)`), t.join("; ");
|
|
31
|
+
}
|
|
32
|
+
var y = (e) => `wb-anim-${String(e).replace(/[^\w-]/g, "")}`, b = (e) => `--wb-anim-${String(e).replace(/[^\w-]/g, "")}`;
|
|
33
|
+
function x(e, t) {
|
|
34
|
+
if (!e || !Array.isArray(t)) return;
|
|
35
|
+
let n = window.getComputedStyle(e), r = t.map((e) => n.getPropertyValue(b(e)).trim()).filter(Boolean);
|
|
36
|
+
r.length && (e.style.animation = "none", e.offsetWidth, e.style.animation = r.join(", "));
|
|
37
|
+
}
|
|
38
|
+
function S(e) {
|
|
39
|
+
return Array.isArray(e) ? e.map((e) => {
|
|
40
|
+
let t = String(e?.id ?? "").replace(/[^\w-]/g, "");
|
|
41
|
+
if (!t) return "";
|
|
42
|
+
let n = y(t), r = v(e.from), i = v(e.to);
|
|
43
|
+
if (!r && !i) return "";
|
|
44
|
+
let a = Math.max(0, _(e.duration) ?? 400), o = Math.max(0, _(e.delay) ?? 0), s = `${n} ${a}ms ${g.includes(e.easing) ? e.easing : "ease-out"} ${o}ms ${e.loop ? "infinite" : "1"} both`;
|
|
45
|
+
return [
|
|
46
|
+
`@keyframes ${n} { from { ${r} } to { ${i} } }`,
|
|
47
|
+
`:root { ${b(t)}: ${s}; }`,
|
|
48
|
+
`.${n} { animation: ${s}; }`
|
|
49
|
+
].join("\n");
|
|
50
|
+
}).filter(Boolean).join("\n") : "";
|
|
51
|
+
}
|
|
52
|
+
var C = new Map([
|
|
17
53
|
{
|
|
18
54
|
family: "Bebas Neue",
|
|
19
55
|
fallback: "sans-serif",
|
|
@@ -144,21 +180,21 @@ var p = /* @__PURE__ */ new Set([
|
|
|
144
180
|
fallback: "sans-serif",
|
|
145
181
|
weights: "100..900"
|
|
146
182
|
}
|
|
147
|
-
].map((e) => [e.family, e])),
|
|
148
|
-
let t =
|
|
183
|
+
].map((e) => [e.family, e])), w = (e) => `"${e.family}", ${e.fallback}`, T = (e) => {
|
|
184
|
+
let t = C.get(e)?.weights;
|
|
149
185
|
return `family=${e.replace(/ /g, "+")}${t ? `:wght@${t}` : ""}`;
|
|
150
186
|
};
|
|
151
|
-
function
|
|
152
|
-
return e.length ? `https://fonts.googleapis.com/css2?${e.map(
|
|
187
|
+
function E(e) {
|
|
188
|
+
return e.length ? `https://fonts.googleapis.com/css2?${e.map(T).join("&")}&display=swap` : null;
|
|
153
189
|
}
|
|
154
|
-
var
|
|
190
|
+
var D = (e) => E([e]), O = (e) => {
|
|
155
191
|
let t = typeof e == "string" && e.match(/^"([^"]+)"/);
|
|
156
192
|
return t ? t[1] : null;
|
|
157
|
-
},
|
|
158
|
-
let t =
|
|
159
|
-
return t ?
|
|
193
|
+
}, k = (e) => {
|
|
194
|
+
let t = C.get(e);
|
|
195
|
+
return t ? w(t) : null;
|
|
160
196
|
};
|
|
161
|
-
function
|
|
197
|
+
function A(e, t) {
|
|
162
198
|
let n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
163
199
|
for (let t of Object.values(e || {})) for (let e of [
|
|
164
200
|
"style",
|
|
@@ -166,7 +202,7 @@ function C(e, t) {
|
|
|
166
202
|
"pressed",
|
|
167
203
|
"focused"
|
|
168
204
|
]) {
|
|
169
|
-
let r =
|
|
205
|
+
let r = O(t.props?.[e]?.fontFamily);
|
|
170
206
|
r && n.add(r);
|
|
171
207
|
}
|
|
172
208
|
};
|
|
@@ -176,107 +212,163 @@ function C(e, t) {
|
|
|
176
212
|
}
|
|
177
213
|
//#endregion
|
|
178
214
|
//#region ../ui/src/components/builder/styles.js
|
|
179
|
-
var
|
|
215
|
+
var j = /* @__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(".")), M = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, N = [
|
|
180
216
|
"borderWidth",
|
|
181
217
|
"borderStyle",
|
|
182
218
|
"borderColor",
|
|
183
219
|
"borderRadius",
|
|
184
220
|
"gap"
|
|
185
221
|
];
|
|
186
|
-
function
|
|
222
|
+
function P(e) {
|
|
187
223
|
let t = {};
|
|
188
|
-
for (let n of
|
|
224
|
+
for (let n of N) {
|
|
189
225
|
let r = e?.[n];
|
|
190
|
-
r != null && r !== "" && (t[n] =
|
|
226
|
+
r != null && r !== "" && (t[n] = j.has(n) ? M(r) : r);
|
|
191
227
|
}
|
|
192
|
-
for (let [n, r] of Object.entries(e || {})) r == null || r === "" ||
|
|
228
|
+
for (let [n, r] of Object.entries(e || {})) r == null || r === "" || N.includes(n) || (t[n] = j.has(n) ? M(r) : r);
|
|
193
229
|
let { gradientType: n, gradientAngle: r, gradientFrom: i, gradientTo: a } = t;
|
|
194
230
|
delete t.gradientType, delete t.gradientAngle, delete t.gradientFrom, delete t.gradientTo;
|
|
195
231
|
let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: u } = t;
|
|
196
232
|
delete t.textShadows, delete t.textShadowX, delete t.textShadowY, delete t.textShadowBlur, delete t.textShadowColor;
|
|
197
|
-
let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${
|
|
233
|
+
let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${M(e.x ?? 0)} ${M(e.y ?? 0)} ${M(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
|
|
198
234
|
[
|
|
199
235
|
s,
|
|
200
236
|
c,
|
|
201
237
|
l,
|
|
202
238
|
u
|
|
203
|
-
].some((e) => e !== void 0) && d.push(`${
|
|
204
|
-
let f = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, p = (e) => e.type === "move" ? `translate(${
|
|
239
|
+
].some((e) => e !== void 0) && d.push(`${M(s ?? 0)} ${M(c ?? 0)} ${M(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), d.length && (t.textShadow = d.join(", "));
|
|
240
|
+
let f = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, p = (e) => e.type === "move" ? `translate(${M(e.x ?? 0)}, ${M(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: b } = t;
|
|
205
241
|
delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
|
|
206
242
|
let x = (Array.isArray(m) ? m : []).filter((e) => e && e.on !== !1).map(p).filter(Boolean);
|
|
207
|
-
(h !== void 0 || g !== void 0) && x.push(`translate(${
|
|
208
|
-
let S = (e) => `${e.inset ? "inset " : ""}${
|
|
243
|
+
(h !== void 0 || g !== void 0) && x.push(`translate(${M(h ?? 0)}, ${M(g ?? 0)})`), _ !== void 0 && x.push(`scale(${_})`), v !== void 0 && x.push(`rotate(${f(v)})`), (y !== void 0 || b !== void 0) && x.push(`skew(${f(y ?? 0)}, ${f(b ?? 0)})`), x.length && (t.transform = x.join(" "));
|
|
244
|
+
let S = (e) => `${e.inset ? "inset " : ""}${M(e.x ?? 0)} ${M(e.y ?? 0)} ${M(e.blur ?? 0)} ${M(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: C, boxShadowX: w, boxShadowY: T, boxShadowBlur: E, boxShadowSpread: D, boxShadowColor: O, boxShadowInset: k } = t;
|
|
209
245
|
delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
|
|
210
|
-
let
|
|
246
|
+
let A = (Array.isArray(C) ? C : []).filter((e) => e && e.on !== !1).map(S);
|
|
211
247
|
[
|
|
248
|
+
w,
|
|
249
|
+
T,
|
|
250
|
+
E,
|
|
212
251
|
D,
|
|
213
252
|
O,
|
|
214
|
-
k
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
inset: M
|
|
225
|
-
})), N.length && (t.boxShadow = N.join(", "));
|
|
226
|
-
let P = (e) => e.type === "blur" ? `blur(${T(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: ee, backdropFilters: te, filterBlur: ne, filterGrayscale: re, filterBrightness: ie, filterContrast: I, filterSaturate: L } = t;
|
|
253
|
+
k
|
|
254
|
+
].some((e) => e !== void 0) && A.push(S({
|
|
255
|
+
x: w,
|
|
256
|
+
y: T,
|
|
257
|
+
blur: E,
|
|
258
|
+
spread: D,
|
|
259
|
+
color: O,
|
|
260
|
+
inset: k
|
|
261
|
+
})), A.length && (t.boxShadow = A.join(", "));
|
|
262
|
+
let P = (e) => e.type === "blur" ? `blur(${M(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: B, filterContrast: V, filterSaturate: H } = t;
|
|
227
263
|
delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
|
|
228
|
-
let
|
|
229
|
-
|
|
230
|
-
let
|
|
231
|
-
|
|
232
|
-
let { textStrokeWidth:
|
|
233
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
234
|
-
let { clipText:
|
|
235
|
-
delete t.clipText,
|
|
236
|
-
let { transitions:
|
|
264
|
+
let U = F(I);
|
|
265
|
+
R !== void 0 && U.push(`blur(${M(R)})`), z !== void 0 && U.push(`grayscale(${z}%)`), B !== void 0 && U.push(`brightness(${B}%)`), V !== void 0 && U.push(`contrast(${V}%)`), H !== void 0 && U.push(`saturate(${H}%)`), U.length && (t.filter = U.join(" "));
|
|
266
|
+
let ee = F(L);
|
|
267
|
+
ee.length && (t.backdropFilter = ee.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
268
|
+
let { textStrokeWidth: te, textStrokeColor: W } = t;
|
|
269
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (te !== void 0 || W !== void 0) && (t.WebkitTextStroke = `${M(te ?? 1)} ${W || "currentColor"}`);
|
|
270
|
+
let { clipText: ne } = t;
|
|
271
|
+
delete t.clipText, ne && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
272
|
+
let { transitions: re, transitionDuration: ie, transitionEasing: ae, transitionProperty: oe } = t, se = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
237
273
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
238
|
-
let
|
|
239
|
-
if (
|
|
274
|
+
let ce = (Array.isArray(re) ? re : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${se(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
275
|
+
if (ie !== void 0 && ce.push(`${oe || "all"} ${se(ie)} ${ae || "ease"}`), ce.length && (t.transition = ce.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
240
276
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
241
277
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
242
278
|
}
|
|
243
279
|
delete t.backgroundVideo;
|
|
244
|
-
let { overlayColor:
|
|
245
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
246
|
-
let e = `color-mix(in srgb, ${
|
|
280
|
+
let { overlayColor: G, overlayOpacity: le } = t;
|
|
281
|
+
if (delete t.overlayColor, delete t.overlayOpacity, G) {
|
|
282
|
+
let e = `color-mix(in srgb, ${G} ${le ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
247
283
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
248
284
|
}
|
|
249
285
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
250
|
-
let { backgroundLayers:
|
|
286
|
+
let { backgroundLayers: ue } = t;
|
|
251
287
|
delete t.backgroundLayers;
|
|
252
|
-
let
|
|
253
|
-
if (
|
|
288
|
+
let de = (Array.isArray(ue) ? ue : []).filter((e) => e && e.on !== !1);
|
|
289
|
+
if (de.length) {
|
|
254
290
|
let e = [], n = [], r = [], i = [], a = [];
|
|
255
|
-
for (let t of
|
|
291
|
+
for (let t of de) 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");
|
|
256
292
|
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");
|
|
257
293
|
else {
|
|
258
294
|
if (!t.src) continue;
|
|
259
|
-
e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${
|
|
295
|
+
e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${M(t.w ?? "auto")} ${M(t.h ?? "auto")}` : t.size || "cover"), r.push(`${M(t.posX ?? 0)} ${M(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
|
|
260
296
|
}
|
|
261
297
|
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(", "));
|
|
262
298
|
}
|
|
263
299
|
return t;
|
|
264
300
|
}
|
|
265
|
-
var
|
|
301
|
+
var F = {
|
|
266
302
|
hover: ":hover",
|
|
267
303
|
pressed: ":active",
|
|
268
304
|
focused: ":focus"
|
|
269
|
-
},
|
|
305
|
+
}, I = /* @__PURE__ */ new Set([
|
|
270
306
|
"style",
|
|
271
307
|
"class",
|
|
272
308
|
"id",
|
|
273
309
|
"data-wb",
|
|
274
310
|
"data-wb-class",
|
|
275
311
|
"data-slot"
|
|
276
|
-
]),
|
|
277
|
-
|
|
312
|
+
]), L = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !I.has(e.toLowerCase()), R = (e) => [...new Set(String(e ?? "").split(/\s+/).map((e) => e.replace(/^\./, "")).filter((e) => /^-?[_a-zA-Z][\w-]*$/.test(e)))], z = [
|
|
313
|
+
"click",
|
|
314
|
+
"dblclick",
|
|
315
|
+
"mouseenter",
|
|
316
|
+
"mouseleave",
|
|
317
|
+
"mousemove",
|
|
318
|
+
"focus",
|
|
319
|
+
"blur",
|
|
320
|
+
"input",
|
|
321
|
+
"change",
|
|
322
|
+
"submit",
|
|
323
|
+
"keydown",
|
|
324
|
+
"inview"
|
|
325
|
+
], B = ["load", "pagescroll"], V = [...z, ...B], H = /^[A-Za-z_$][\w$]*$/;
|
|
326
|
+
function U(e, t) {
|
|
327
|
+
let n = String(t ?? "").trim();
|
|
328
|
+
if (!n) return [e];
|
|
329
|
+
let r = e.closest?.(".webim-page") ?? e.closest?.(".builder-canvas") ?? document, i = /^[A-Za-z_][\w-]*$/.test(n) ? [`#${n}`, n] : [n];
|
|
330
|
+
for (let e of i) try {
|
|
331
|
+
let t = Array.from(r.querySelectorAll(e));
|
|
332
|
+
if (t.length) return t;
|
|
333
|
+
} catch {
|
|
334
|
+
return [];
|
|
335
|
+
}
|
|
336
|
+
return [];
|
|
337
|
+
}
|
|
338
|
+
function ee(e, t) {
|
|
339
|
+
for (let t of e.__webimEvents ?? []) t();
|
|
340
|
+
let n = [];
|
|
341
|
+
for (let r of t ?? []) {
|
|
342
|
+
let t = String(r?.event ?? ""), i = r?.action === "animation", a = i ? (Array.isArray(r?.animations) ? r.animations : [r?.animation]).map((e) => String(e ?? "").trim()).filter(Boolean) : [], o = i ? "" : String(r?.handler ?? "").trim();
|
|
343
|
+
if (!V.includes(t) || (i ? !a.length : !H.test(o))) continue;
|
|
344
|
+
let s = (t) => {
|
|
345
|
+
if (i) {
|
|
346
|
+
for (let t of U(e, r?.target)) x(t, a);
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
let n = window[o];
|
|
350
|
+
typeof n == "function" && n.call(e, t);
|
|
351
|
+
};
|
|
352
|
+
if (t === "inview") {
|
|
353
|
+
if (typeof IntersectionObserver > "u") continue;
|
|
354
|
+
let t = new IntersectionObserver((e) => {
|
|
355
|
+
for (let n of e) n.isIntersecting && (t.disconnect(), s(n));
|
|
356
|
+
});
|
|
357
|
+
t.observe(e), n.push(() => t.disconnect());
|
|
358
|
+
} else if (t === "load") if (document.readyState === "complete") {
|
|
359
|
+
let e = setTimeout(s, 0);
|
|
360
|
+
n.push(() => clearTimeout(e));
|
|
361
|
+
} else window.addEventListener("load", s, { once: !0 }), n.push(() => window.removeEventListener("load", s));
|
|
362
|
+
else t === "pagescroll" ? (document.addEventListener("scroll", s, {
|
|
363
|
+
capture: !0,
|
|
364
|
+
passive: !0
|
|
365
|
+
}), n.push(() => document.removeEventListener("scroll", s, { capture: !0 }))) : (e.addEventListener(t, s), n.push(() => e.removeEventListener(t, s)));
|
|
366
|
+
}
|
|
367
|
+
e.__webimEvents = n;
|
|
368
|
+
}
|
|
369
|
+
function te(e, t, n = []) {
|
|
278
370
|
t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
|
|
279
|
-
let r =
|
|
371
|
+
let r = R(t.classNames), i = R(e.getAttribute("data-wb-class"));
|
|
280
372
|
for (let t of i) r.includes(t) || e.classList.remove(t);
|
|
281
373
|
for (let t of r) e.classList.add(t);
|
|
282
374
|
r.length ? e.setAttribute("data-wb-class", r.join(" ")) : e.removeAttribute("data-wb-class");
|
|
@@ -284,19 +376,19 @@ function M(e, t, n = []) {
|
|
|
284
376
|
let a = [];
|
|
285
377
|
for (let n of t.attributes ?? []) {
|
|
286
378
|
let t = String(n?.name ?? "").trim();
|
|
287
|
-
|
|
379
|
+
L(t) && (e.setAttribute(t, n.value ?? ""), a.push(t));
|
|
288
380
|
}
|
|
289
381
|
return a;
|
|
290
382
|
}
|
|
291
|
-
var
|
|
292
|
-
function
|
|
293
|
-
let i = Object.entries(
|
|
383
|
+
var W = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
384
|
+
function ne(e, t, n, r = !1) {
|
|
385
|
+
let i = Object.entries(P(t)).map(([e, t]) => `${W(e)}: ${t} !important;`).join(" ");
|
|
294
386
|
return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
|
|
295
387
|
}
|
|
296
|
-
function
|
|
297
|
-
return Object.entries(
|
|
388
|
+
function re(e, t, n) {
|
|
389
|
+
return Object.entries(F).map(([r, i]) => ne(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
298
390
|
}
|
|
299
|
-
var
|
|
391
|
+
var ie = [
|
|
300
392
|
{
|
|
301
393
|
key: "tablet",
|
|
302
394
|
max: 991
|
|
@@ -309,17 +401,17 @@ var ee = [
|
|
|
309
401
|
key: "mobile",
|
|
310
402
|
max: 478
|
|
311
403
|
}
|
|
312
|
-
],
|
|
313
|
-
function
|
|
314
|
-
return
|
|
315
|
-
let i = t?.[n] ?
|
|
404
|
+
], ae = (e) => Object.entries(P(e)).map(([e, t]) => `${W(e)}: ${t} !important;`).join(" ");
|
|
405
|
+
function oe(e, t) {
|
|
406
|
+
return ie.map(({ key: n, max: r }) => {
|
|
407
|
+
let i = t?.[n] ? ae(t[n]) : "";
|
|
316
408
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
317
409
|
}).filter(Boolean).join("\n");
|
|
318
410
|
}
|
|
319
|
-
function
|
|
411
|
+
function se(e, t) {
|
|
320
412
|
let n = [], r = (e) => {
|
|
321
413
|
for (let [t, r] of Object.entries(e || {})) {
|
|
322
|
-
let e =
|
|
414
|
+
let e = oe(t, r.props);
|
|
323
415
|
e && n.push(e);
|
|
324
416
|
}
|
|
325
417
|
};
|
|
@@ -327,10 +419,10 @@ function re(e, t) {
|
|
|
327
419
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
328
420
|
return n.join("\n");
|
|
329
421
|
}
|
|
330
|
-
function
|
|
422
|
+
function ce(e, t) {
|
|
331
423
|
let n = [], r = (e) => {
|
|
332
424
|
for (let [t, r] of Object.entries(e || {})) {
|
|
333
|
-
let e =
|
|
425
|
+
let e = re(t, r.props);
|
|
334
426
|
e && n.push(e);
|
|
335
427
|
}
|
|
336
428
|
};
|
|
@@ -338,7 +430,7 @@ function ie(e, t) {
|
|
|
338
430
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
339
431
|
return n.join("\n");
|
|
340
432
|
}
|
|
341
|
-
var
|
|
433
|
+
var G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", le = {
|
|
342
434
|
light: {
|
|
343
435
|
background: "#f2f2f2",
|
|
344
436
|
surface: "#f2f2f2",
|
|
@@ -379,23 +471,23 @@ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
379
471
|
contrastText: "#052e2b"
|
|
380
472
|
}
|
|
381
473
|
}
|
|
382
|
-
},
|
|
474
|
+
}, ue = {
|
|
383
475
|
font: "system",
|
|
384
476
|
headingFont: "inherit",
|
|
385
|
-
light:
|
|
386
|
-
dark:
|
|
387
|
-
},
|
|
477
|
+
light: le.light,
|
|
478
|
+
dark: le.dark
|
|
479
|
+
}, de = {
|
|
388
480
|
system: {
|
|
389
481
|
label: "System",
|
|
390
|
-
value:
|
|
482
|
+
value: G
|
|
391
483
|
},
|
|
392
484
|
inter: {
|
|
393
485
|
label: "Inter",
|
|
394
|
-
value: `"Inter", ${
|
|
486
|
+
value: `"Inter", ${G}`
|
|
395
487
|
},
|
|
396
488
|
outfit: {
|
|
397
489
|
label: "Outfit",
|
|
398
|
-
value: `"Outfit", ${
|
|
490
|
+
value: `"Outfit", ${G}`
|
|
399
491
|
},
|
|
400
492
|
serif: {
|
|
401
493
|
label: "Serif",
|
|
@@ -405,7 +497,7 @@ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
405
497
|
label: "Mono",
|
|
406
498
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
407
499
|
}
|
|
408
|
-
},
|
|
500
|
+
}, fe = (e, t) => de[e]?.value ?? k(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), pe = (e, ...t) => {
|
|
409
501
|
let n = Object.assign({}, e, ...t);
|
|
410
502
|
return n.primary = {
|
|
411
503
|
...e.primary,
|
|
@@ -421,20 +513,20 @@ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
421
513
|
}), {})
|
|
422
514
|
}, n;
|
|
423
515
|
};
|
|
424
|
-
function
|
|
516
|
+
function me(e) {
|
|
425
517
|
let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
|
|
426
518
|
return {
|
|
427
|
-
font: r ??
|
|
428
|
-
headingFont: i ??
|
|
429
|
-
light:
|
|
430
|
-
dark:
|
|
519
|
+
font: r ?? ue.font,
|
|
520
|
+
headingFont: i ?? ue.headingFont,
|
|
521
|
+
light: pe(le.light, a, t),
|
|
522
|
+
dark: pe(le.dark, n)
|
|
431
523
|
};
|
|
432
524
|
}
|
|
433
|
-
function
|
|
525
|
+
function he(e) {
|
|
434
526
|
return {
|
|
435
527
|
"--page-bg": e.background,
|
|
436
528
|
"--page-surface": e.surface ?? e.background,
|
|
437
|
-
"--page-border": e.border ??
|
|
529
|
+
"--page-border": e.border ?? le.light.border,
|
|
438
530
|
"--page-text": e.text,
|
|
439
531
|
"--page-accent": e.accent,
|
|
440
532
|
"--page-accent-text": e.accentText,
|
|
@@ -448,58 +540,58 @@ function B(e) {
|
|
|
448
540
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
449
541
|
};
|
|
450
542
|
}
|
|
451
|
-
function
|
|
452
|
-
let t =
|
|
543
|
+
function ge(e) {
|
|
544
|
+
let t = me(e);
|
|
453
545
|
return {
|
|
454
546
|
backgroundColor: "var(--page-bg)",
|
|
455
547
|
color: "var(--page-text)",
|
|
456
|
-
fontFamily:
|
|
457
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
548
|
+
fontFamily: fe(t.font, G),
|
|
549
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : fe(t.headingFont, "inherit")
|
|
458
550
|
};
|
|
459
551
|
}
|
|
460
|
-
function
|
|
461
|
-
let n =
|
|
552
|
+
function _e(e, t = "light") {
|
|
553
|
+
let n = me(e);
|
|
462
554
|
return {
|
|
463
|
-
...
|
|
464
|
-
...
|
|
555
|
+
...ge(e),
|
|
556
|
+
...he(n[t] ?? n.light)
|
|
465
557
|
};
|
|
466
558
|
}
|
|
467
|
-
function
|
|
559
|
+
function ve(e, t) {
|
|
468
560
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
469
561
|
}
|
|
470
|
-
function
|
|
562
|
+
function ye(e, t) {
|
|
471
563
|
return e === "light" || e === "dark" ? e : t === "light" || t === "dark" ? t : "auto";
|
|
472
564
|
}
|
|
473
565
|
//#endregion
|
|
474
566
|
//#region ../ui/src/components/builder/views.jsx
|
|
475
|
-
var
|
|
567
|
+
var K = n({
|
|
476
568
|
tenant: "",
|
|
477
569
|
apiUrl: "/api",
|
|
478
570
|
locale: "",
|
|
479
571
|
settings: null
|
|
480
|
-
}),
|
|
572
|
+
}), q = n(null), be = (e) => {
|
|
481
573
|
let t = Number(e?.__page);
|
|
482
574
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
483
575
|
if (typeof window > "u") return 1;
|
|
484
576
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
485
577
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
486
|
-
},
|
|
578
|
+
}, xe = () => {
|
|
487
579
|
if (typeof window > "u") return {};
|
|
488
580
|
let e = {};
|
|
489
581
|
return new URLSearchParams(window.location.search).forEach((t, n) => {
|
|
490
582
|
n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
|
|
491
583
|
}), e;
|
|
492
|
-
},
|
|
584
|
+
}, Se = (e) => {
|
|
493
585
|
let t = {
|
|
494
586
|
...e && typeof e == "object" && !Array.isArray(e) ? e : {},
|
|
495
|
-
...
|
|
587
|
+
...xe()
|
|
496
588
|
};
|
|
497
589
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
498
|
-
},
|
|
499
|
-
function
|
|
590
|
+
}, Ce = n(null), we = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
591
|
+
function Te(e, t) {
|
|
500
592
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
501
593
|
}
|
|
502
|
-
var
|
|
594
|
+
var Ee = (e) => {
|
|
503
595
|
let t = [];
|
|
504
596
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
505
597
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -509,36 +601,36 @@ var _e = (e) => {
|
|
|
509
601
|
}
|
|
510
602
|
return t;
|
|
511
603
|
};
|
|
512
|
-
function
|
|
604
|
+
function J(e) {
|
|
513
605
|
return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : typeof e == "object" && !Array.isArray(e) && Number.isFinite(Number(e.lat)) && Number.isFinite(Number(e.lng)) ? `${e.lat}, ${e.lng}` : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
|
|
514
606
|
}
|
|
515
|
-
function
|
|
516
|
-
let n = t?.data ?? {}, r =
|
|
607
|
+
function De(e, t) {
|
|
608
|
+
let n = t?.data ?? {}, r = Ee(n);
|
|
517
609
|
if (!r.length) return e;
|
|
518
|
-
let i = RegExp(`:(${r.map(
|
|
610
|
+
let i = RegExp(`:(${r.map(we).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => J(Te(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
519
611
|
return a(e);
|
|
520
612
|
}
|
|
521
|
-
var
|
|
613
|
+
var Oe = {
|
|
522
614
|
margin: 0,
|
|
523
615
|
fontWeight: 700,
|
|
524
616
|
lineHeight: 1.2,
|
|
525
617
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
526
|
-
},
|
|
618
|
+
}, ke = { margin: 0 }, Y = {
|
|
527
619
|
display: "inline-block",
|
|
528
620
|
textDecoration: "none",
|
|
529
621
|
cursor: "pointer",
|
|
530
622
|
backgroundColor: "var(--page-accent, #111827)",
|
|
531
623
|
color: "var(--page-accent-text, #ffffff)"
|
|
532
|
-
},
|
|
624
|
+
}, Ae = {
|
|
533
625
|
flexGrow: 1,
|
|
534
626
|
display: "flex",
|
|
535
627
|
flexDirection: "column",
|
|
536
628
|
position: "relative"
|
|
537
|
-
},
|
|
629
|
+
}, je = {
|
|
538
630
|
display: "flex",
|
|
539
631
|
flexDirection: "column"
|
|
540
632
|
};
|
|
541
|
-
function
|
|
633
|
+
function Me({ style: e }) {
|
|
542
634
|
let t = e?.backgroundVideo;
|
|
543
635
|
if (!t) return null;
|
|
544
636
|
let n = {
|
|
@@ -564,32 +656,32 @@ function Ce({ style: e }) {
|
|
|
564
656
|
background: r
|
|
565
657
|
} })] });
|
|
566
658
|
}
|
|
567
|
-
var
|
|
659
|
+
var Ne = (e, t) => e?.backgroundVideo ? {
|
|
568
660
|
position: "relative",
|
|
569
661
|
...t,
|
|
570
|
-
...
|
|
662
|
+
...P(e)
|
|
571
663
|
} : {
|
|
572
664
|
...t,
|
|
573
|
-
...
|
|
665
|
+
...P(e)
|
|
574
666
|
};
|
|
575
|
-
function
|
|
667
|
+
function Pe({ style: e, nodeRef: t, children: n }) {
|
|
576
668
|
return /* @__PURE__ */ f("div", {
|
|
577
669
|
ref: t,
|
|
578
670
|
style: {
|
|
579
|
-
...
|
|
580
|
-
...
|
|
671
|
+
...Ae,
|
|
672
|
+
...P(e)
|
|
581
673
|
},
|
|
582
|
-
children: [/* @__PURE__ */ d(
|
|
674
|
+
children: [/* @__PURE__ */ d(Me, { style: e }), n]
|
|
583
675
|
});
|
|
584
676
|
}
|
|
585
|
-
function
|
|
677
|
+
function Fe({ style: e, nodeRef: t, children: n }) {
|
|
586
678
|
return /* @__PURE__ */ f("section", {
|
|
587
679
|
ref: t,
|
|
588
|
-
style:
|
|
589
|
-
children: [/* @__PURE__ */ d(
|
|
680
|
+
style: Ne(e, je),
|
|
681
|
+
children: [/* @__PURE__ */ d(Me, { style: e }), n]
|
|
590
682
|
});
|
|
591
683
|
}
|
|
592
|
-
function
|
|
684
|
+
function Ie({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
593
685
|
let i = t ? {
|
|
594
686
|
position: "relative",
|
|
595
687
|
minHeight: 240
|
|
@@ -598,32 +690,32 @@ function De({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
598
690
|
ref: n,
|
|
599
691
|
style: i ? {
|
|
600
692
|
...i,
|
|
601
|
-
...
|
|
602
|
-
} :
|
|
603
|
-
children: [/* @__PURE__ */ d(
|
|
693
|
+
...Ne(e)
|
|
694
|
+
} : Ne(e),
|
|
695
|
+
children: [/* @__PURE__ */ d(Me, { style: e }), r]
|
|
604
696
|
});
|
|
605
697
|
}
|
|
606
|
-
function
|
|
698
|
+
function Le({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
607
699
|
return /* @__PURE__ */ d(n, {
|
|
608
700
|
ref: a,
|
|
609
701
|
style: {
|
|
610
|
-
...
|
|
611
|
-
...
|
|
702
|
+
...Oe,
|
|
703
|
+
...P(r)
|
|
612
704
|
},
|
|
613
|
-
children:
|
|
705
|
+
children: X(t, e, i)
|
|
614
706
|
});
|
|
615
707
|
}
|
|
616
|
-
var
|
|
617
|
-
fontFamily:
|
|
708
|
+
var Re = {
|
|
709
|
+
fontFamily: de.mono.value,
|
|
618
710
|
background: "rgba(148, 163, 184, 0.18)",
|
|
619
711
|
padding: "1px 5px",
|
|
620
712
|
borderRadius: 4,
|
|
621
713
|
fontSize: "0.9em"
|
|
622
714
|
};
|
|
623
|
-
function
|
|
715
|
+
function ze(e, t = [], n, r) {
|
|
624
716
|
let i = e;
|
|
625
717
|
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", {
|
|
626
|
-
style:
|
|
718
|
+
style: Re,
|
|
627
719
|
children: i
|
|
628
720
|
})), 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", {
|
|
629
721
|
href: n,
|
|
@@ -633,13 +725,13 @@ function Ae(e, t = [], n, r) {
|
|
|
633
725
|
children: i
|
|
634
726
|
})), i;
|
|
635
727
|
}
|
|
636
|
-
function
|
|
728
|
+
function X(e, n, r) {
|
|
637
729
|
return e?.length ? e.map((e, n) => {
|
|
638
730
|
if (e.slot) return /* @__PURE__ */ d(t, { children: r?.[e.slot] ?? null }, n);
|
|
639
|
-
if (e.parts) return /* @__PURE__ */ d(t, { children:
|
|
731
|
+
if (e.parts) return /* @__PURE__ */ d(t, { children: X(e.parts, "", r) }, n);
|
|
640
732
|
let i = e.text;
|
|
641
733
|
return e.sup ? i = /* @__PURE__ */ d("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ d("sub", { children: i })), e.code && (i = /* @__PURE__ */ d("code", {
|
|
642
|
-
style:
|
|
734
|
+
style: Re,
|
|
643
735
|
children: i
|
|
644
736
|
})), 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", {
|
|
645
737
|
style: {
|
|
@@ -656,13 +748,13 @@ function K(e, n, r) {
|
|
|
656
748
|
})), /* @__PURE__ */ d(t, { children: i }, n);
|
|
657
749
|
}) : n;
|
|
658
750
|
}
|
|
659
|
-
function
|
|
751
|
+
function Be({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
660
752
|
return /* @__PURE__ */ d("span", {
|
|
661
|
-
style:
|
|
662
|
-
children: e?.length ?
|
|
753
|
+
style: P(a),
|
|
754
|
+
children: e?.length ? X(e, t) : ze(t, n, r, i)
|
|
663
755
|
});
|
|
664
756
|
}
|
|
665
|
-
var
|
|
757
|
+
var Ve = {
|
|
666
758
|
h1: 40,
|
|
667
759
|
h2: 32,
|
|
668
760
|
h3: 26,
|
|
@@ -670,7 +762,7 @@ var Me = {
|
|
|
670
762
|
h5: 19,
|
|
671
763
|
h6: 16
|
|
672
764
|
};
|
|
673
|
-
function
|
|
765
|
+
function He({ align: e = "center", width: t, wrap: n } = {}) {
|
|
674
766
|
let r = t ? `${t}%` : void 0;
|
|
675
767
|
if (e === "full") return { width: "100%" };
|
|
676
768
|
let i = e === "left" || e === "right";
|
|
@@ -704,8 +796,8 @@ function Ne({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
704
796
|
marginRight: "auto"
|
|
705
797
|
};
|
|
706
798
|
}
|
|
707
|
-
function
|
|
708
|
-
let r = n ?? ((e, n) =>
|
|
799
|
+
function Ue(e = [], t, n) {
|
|
800
|
+
let r = n ?? ((e, n) => X(e, n, t));
|
|
709
801
|
return e.map((t, n) => {
|
|
710
802
|
let i = {
|
|
711
803
|
marginTop: 0,
|
|
@@ -727,7 +819,7 @@ function Pe(e = [], t, n) {
|
|
|
727
819
|
marginLeft: 0,
|
|
728
820
|
marginRight: 0,
|
|
729
821
|
...i,
|
|
730
|
-
...
|
|
822
|
+
...He(t)
|
|
731
823
|
},
|
|
732
824
|
children: [t.href ? /* @__PURE__ */ d("a", {
|
|
733
825
|
href: t.href,
|
|
@@ -746,16 +838,16 @@ function Pe(e = [], t, n) {
|
|
|
746
838
|
})]
|
|
747
839
|
}, n);
|
|
748
840
|
}
|
|
749
|
-
if (t.type === "video") return
|
|
841
|
+
if (t.type === "video") return et(t.url) ? /* @__PURE__ */ d("div", {
|
|
750
842
|
style: {
|
|
751
843
|
...i,
|
|
752
|
-
...
|
|
844
|
+
...He({
|
|
753
845
|
align: t.align,
|
|
754
846
|
wrap: t.wrap,
|
|
755
847
|
width: t.width ?? 100
|
|
756
848
|
})
|
|
757
849
|
},
|
|
758
|
-
children: /* @__PURE__ */ d(
|
|
850
|
+
children: /* @__PURE__ */ d(tt, {
|
|
759
851
|
url: t.url,
|
|
760
852
|
autoplay: t.autoplay,
|
|
761
853
|
muted: t.muted,
|
|
@@ -817,17 +909,17 @@ function Pe(e = [], t, n) {
|
|
|
817
909
|
}
|
|
818
910
|
if (t.type === "quote") return /* @__PURE__ */ d("blockquote", {
|
|
819
911
|
style: {
|
|
820
|
-
...
|
|
912
|
+
...Ge,
|
|
821
913
|
...i
|
|
822
914
|
},
|
|
823
915
|
children: r(t.parts, t.text)
|
|
824
916
|
}, n);
|
|
825
|
-
if (
|
|
917
|
+
if (Ve[t.type]) {
|
|
826
918
|
let e = t.type;
|
|
827
919
|
return /* @__PURE__ */ d(e, {
|
|
828
920
|
style: {
|
|
829
|
-
...
|
|
830
|
-
fontSize:
|
|
921
|
+
...Oe,
|
|
922
|
+
fontSize: Ve[t.type],
|
|
831
923
|
...i
|
|
832
924
|
},
|
|
833
925
|
children: r(t.parts, t.text)
|
|
@@ -835,95 +927,95 @@ function Pe(e = [], t, n) {
|
|
|
835
927
|
}
|
|
836
928
|
return /* @__PURE__ */ d("p", {
|
|
837
929
|
style: {
|
|
838
|
-
...
|
|
930
|
+
...ke,
|
|
839
931
|
...i
|
|
840
932
|
},
|
|
841
933
|
children: r(t.parts, t.text)
|
|
842
934
|
}, n);
|
|
843
935
|
});
|
|
844
936
|
}
|
|
845
|
-
function
|
|
937
|
+
function We({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
846
938
|
return /* @__PURE__ */ d("div", {
|
|
847
939
|
ref: r,
|
|
848
940
|
style: {
|
|
849
941
|
display: "flow-root",
|
|
850
|
-
...
|
|
942
|
+
...P(t)
|
|
851
943
|
},
|
|
852
|
-
children:
|
|
944
|
+
children: Ue(e, n)
|
|
853
945
|
});
|
|
854
946
|
}
|
|
855
|
-
var
|
|
947
|
+
var Ge = {
|
|
856
948
|
margin: 0,
|
|
857
949
|
padding: "8px 0 8px 20px",
|
|
858
950
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
859
951
|
};
|
|
860
|
-
function
|
|
952
|
+
function Ke({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
861
953
|
return /* @__PURE__ */ d("blockquote", {
|
|
862
954
|
ref: i,
|
|
863
955
|
style: {
|
|
864
|
-
...
|
|
865
|
-
...
|
|
956
|
+
...Ge,
|
|
957
|
+
...P(n)
|
|
866
958
|
},
|
|
867
|
-
children:
|
|
959
|
+
children: X(t, e, r)
|
|
868
960
|
});
|
|
869
961
|
}
|
|
870
|
-
function
|
|
962
|
+
function qe({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
871
963
|
return /* @__PURE__ */ d(e ? "ol" : "ul", {
|
|
872
964
|
ref: r,
|
|
873
965
|
style: {
|
|
874
966
|
margin: 0,
|
|
875
967
|
paddingLeft: 24,
|
|
876
|
-
...
|
|
968
|
+
...P(n)
|
|
877
969
|
},
|
|
878
970
|
children: t.map((e, t) => /* @__PURE__ */ d("li", {
|
|
879
971
|
style: { marginBottom: 4 },
|
|
880
|
-
children:
|
|
972
|
+
children: X(e.parts, e.text)
|
|
881
973
|
}, t))
|
|
882
974
|
});
|
|
883
975
|
}
|
|
884
|
-
function
|
|
976
|
+
function Je({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
885
977
|
return /* @__PURE__ */ d("p", {
|
|
886
978
|
ref: i,
|
|
887
979
|
style: {
|
|
888
|
-
...
|
|
889
|
-
...
|
|
980
|
+
...ke,
|
|
981
|
+
...P(n)
|
|
890
982
|
},
|
|
891
|
-
children:
|
|
983
|
+
children: X(t, e, r)
|
|
892
984
|
});
|
|
893
985
|
}
|
|
894
|
-
var
|
|
986
|
+
var Ye = {
|
|
895
987
|
color: "var(--page-accent, inherit)",
|
|
896
988
|
textDecoration: "underline",
|
|
897
989
|
textUnderlineOffset: 3,
|
|
898
990
|
cursor: "pointer"
|
|
899
991
|
};
|
|
900
|
-
function
|
|
992
|
+
function Xe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
901
993
|
return /* @__PURE__ */ d("a", {
|
|
902
994
|
ref: o,
|
|
903
995
|
href: n || "#",
|
|
904
996
|
target: r || void 0,
|
|
905
997
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
906
998
|
style: {
|
|
907
|
-
...
|
|
908
|
-
...
|
|
999
|
+
...Ye,
|
|
1000
|
+
...P(i)
|
|
909
1001
|
},
|
|
910
|
-
children:
|
|
1002
|
+
children: X(t, e, a)
|
|
911
1003
|
});
|
|
912
1004
|
}
|
|
913
|
-
function
|
|
1005
|
+
function Ze({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
914
1006
|
return /* @__PURE__ */ d("a", {
|
|
915
1007
|
ref: o,
|
|
916
1008
|
href: n || "#",
|
|
917
1009
|
target: r || void 0,
|
|
918
1010
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
919
1011
|
style: {
|
|
920
|
-
...
|
|
921
|
-
...
|
|
1012
|
+
...Y,
|
|
1013
|
+
...P(i)
|
|
922
1014
|
},
|
|
923
|
-
children:
|
|
1015
|
+
children: X(t, e, a)
|
|
924
1016
|
});
|
|
925
1017
|
}
|
|
926
|
-
function
|
|
1018
|
+
function Qe({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
927
1019
|
return e ? /* @__PURE__ */ d("img", {
|
|
928
1020
|
ref: r,
|
|
929
1021
|
src: e,
|
|
@@ -931,11 +1023,11 @@ function Ue({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
931
1023
|
style: {
|
|
932
1024
|
display: "block",
|
|
933
1025
|
maxWidth: "100%",
|
|
934
|
-
...
|
|
1026
|
+
...P(n)
|
|
935
1027
|
}
|
|
936
1028
|
}) : null;
|
|
937
1029
|
}
|
|
938
|
-
function
|
|
1030
|
+
function $e({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
939
1031
|
return e ? /* @__PURE__ */ d("video", {
|
|
940
1032
|
ref: s,
|
|
941
1033
|
src: e,
|
|
@@ -949,13 +1041,13 @@ function We({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
949
1041
|
display: "block",
|
|
950
1042
|
width: "100%",
|
|
951
1043
|
maxWidth: "100%",
|
|
952
|
-
...
|
|
1044
|
+
...P(o)
|
|
953
1045
|
}
|
|
954
1046
|
}) : null;
|
|
955
1047
|
}
|
|
956
|
-
var
|
|
957
|
-
function
|
|
958
|
-
let c =
|
|
1048
|
+
var et = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
1049
|
+
function tt({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
1050
|
+
let c = et(e);
|
|
959
1051
|
if (!c) return null;
|
|
960
1052
|
let l = new URLSearchParams({ rel: "0" });
|
|
961
1053
|
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", {
|
|
@@ -964,7 +1056,7 @@ function Ke({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
964
1056
|
position: "relative",
|
|
965
1057
|
width: "100%",
|
|
966
1058
|
paddingTop: "56.25%",
|
|
967
|
-
...
|
|
1059
|
+
...P(o)
|
|
968
1060
|
},
|
|
969
1061
|
children: /* @__PURE__ */ d("iframe", {
|
|
970
1062
|
src: `https://www.youtube-nocookie.com/embed/${c}?${l}`,
|
|
@@ -981,7 +1073,7 @@ function Ke({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
981
1073
|
})
|
|
982
1074
|
});
|
|
983
1075
|
}
|
|
984
|
-
function
|
|
1076
|
+
function nt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
985
1077
|
return e ? /* @__PURE__ */ d("iframe", {
|
|
986
1078
|
ref: i,
|
|
987
1079
|
src: e,
|
|
@@ -993,11 +1085,11 @@ function qe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
993
1085
|
width: "100%",
|
|
994
1086
|
height: 300,
|
|
995
1087
|
border: 0,
|
|
996
|
-
...
|
|
1088
|
+
...P(r)
|
|
997
1089
|
}
|
|
998
1090
|
}) : null;
|
|
999
1091
|
}
|
|
1000
|
-
function
|
|
1092
|
+
function rt({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
1001
1093
|
let [i, o] = l(null);
|
|
1002
1094
|
return a(() => {
|
|
1003
1095
|
i && (i.innerHTML = e || "", t && i.querySelectorAll("script").forEach((e) => {
|
|
@@ -1013,10 +1105,10 @@ function Je({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
|
1013
1105
|
ref: (e) => {
|
|
1014
1106
|
o(e), r && r(e);
|
|
1015
1107
|
},
|
|
1016
|
-
style:
|
|
1108
|
+
style: P(n)
|
|
1017
1109
|
});
|
|
1018
1110
|
}
|
|
1019
|
-
function
|
|
1111
|
+
function it({ height: e, nodeRef: t }) {
|
|
1020
1112
|
return /* @__PURE__ */ d("div", {
|
|
1021
1113
|
ref: t,
|
|
1022
1114
|
style: {
|
|
@@ -1026,18 +1118,18 @@ function Ye({ height: e, nodeRef: t }) {
|
|
|
1026
1118
|
}
|
|
1027
1119
|
});
|
|
1028
1120
|
}
|
|
1029
|
-
function
|
|
1121
|
+
function at({ style: e, nodeRef: t }) {
|
|
1030
1122
|
return /* @__PURE__ */ d("div", {
|
|
1031
1123
|
ref: t,
|
|
1032
1124
|
style: {
|
|
1033
1125
|
height: 1,
|
|
1034
1126
|
alignSelf: "stretch",
|
|
1035
1127
|
flexShrink: 0,
|
|
1036
|
-
...
|
|
1128
|
+
...P(e)
|
|
1037
1129
|
}
|
|
1038
1130
|
});
|
|
1039
1131
|
}
|
|
1040
|
-
var
|
|
1132
|
+
var ot = {
|
|
1041
1133
|
position: "absolute",
|
|
1042
1134
|
top: "50%",
|
|
1043
1135
|
transform: "translateY(-50%)",
|
|
@@ -1054,7 +1146,7 @@ var Ze = {
|
|
|
1054
1146
|
alignItems: "center",
|
|
1055
1147
|
justifyContent: "center",
|
|
1056
1148
|
padding: 0
|
|
1057
|
-
},
|
|
1149
|
+
}, st = {
|
|
1058
1150
|
bottom: {
|
|
1059
1151
|
inset: "auto 0 0 0",
|
|
1060
1152
|
padding: "40px 24px 20px",
|
|
@@ -1073,8 +1165,8 @@ var Ze = {
|
|
|
1073
1165
|
padding: 24,
|
|
1074
1166
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1075
1167
|
}
|
|
1076
|
-
},
|
|
1077
|
-
function
|
|
1168
|
+
}, ct = 48;
|
|
1169
|
+
function lt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
|
|
1078
1170
|
let [p, m] = l(0), [h, g] = l(!1), [_, v] = l(null), y = e ? Math.min(p, e - 1) : 0;
|
|
1079
1171
|
if (a(() => {
|
|
1080
1172
|
if (!n || h || _ || e < 2) return;
|
|
@@ -1090,7 +1182,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1090
1182
|
let b = (t) => m((t + e) % e), x = () => {
|
|
1091
1183
|
if (!_) return;
|
|
1092
1184
|
let { dx: e } = _;
|
|
1093
|
-
v(null), e < -48 ? b(y + 1) : e >
|
|
1185
|
+
v(null), e < -48 ? b(y + 1) : e > ct && b(y - 1);
|
|
1094
1186
|
};
|
|
1095
1187
|
return /* @__PURE__ */ f("div", {
|
|
1096
1188
|
ref: c,
|
|
@@ -1115,7 +1207,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1115
1207
|
touchAction: "pan-y",
|
|
1116
1208
|
userSelect: _ ? "none" : void 0,
|
|
1117
1209
|
cursor: _ ? "grabbing" : void 0,
|
|
1118
|
-
...
|
|
1210
|
+
...P(s)
|
|
1119
1211
|
},
|
|
1120
1212
|
children: [/* @__PURE__ */ d("div", {
|
|
1121
1213
|
style: {
|
|
@@ -1138,7 +1230,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1138
1230
|
type: "button",
|
|
1139
1231
|
"aria-label": "Previous slide",
|
|
1140
1232
|
style: {
|
|
1141
|
-
...
|
|
1233
|
+
...ot,
|
|
1142
1234
|
left: 12
|
|
1143
1235
|
},
|
|
1144
1236
|
onClick: () => b(y - 1),
|
|
@@ -1148,7 +1240,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1148
1240
|
type: "button",
|
|
1149
1241
|
"aria-label": "Next slide",
|
|
1150
1242
|
style: {
|
|
1151
|
-
...
|
|
1243
|
+
...ot,
|
|
1152
1244
|
right: 12
|
|
1153
1245
|
},
|
|
1154
1246
|
onClick: () => b(y + 1),
|
|
@@ -1182,7 +1274,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1182
1274
|
] })]
|
|
1183
1275
|
});
|
|
1184
1276
|
}
|
|
1185
|
-
var
|
|
1277
|
+
var ut = (e, t) => ({
|
|
1186
1278
|
position: "absolute",
|
|
1187
1279
|
inset: 0,
|
|
1188
1280
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1190,18 +1282,18 @@ var tt = (e, t) => ({
|
|
|
1190
1282
|
backgroundSize: "cover",
|
|
1191
1283
|
backgroundPosition: "center"
|
|
1192
1284
|
});
|
|
1193
|
-
function
|
|
1194
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1285
|
+
function dt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1286
|
+
return e.length ? /* @__PURE__ */ d(lt, {
|
|
1195
1287
|
...r,
|
|
1196
1288
|
count: e.length,
|
|
1197
1289
|
renderSlide: (r) => {
|
|
1198
1290
|
let i = e[r];
|
|
1199
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1291
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: ut(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
|
|
1200
1292
|
style: {
|
|
1201
1293
|
position: "absolute",
|
|
1202
1294
|
color: "#fff",
|
|
1203
1295
|
textAlign: n,
|
|
1204
|
-
...
|
|
1296
|
+
...st[t] ?? st.bottom
|
|
1205
1297
|
},
|
|
1206
1298
|
children: [i.title && /* @__PURE__ */ d("div", {
|
|
1207
1299
|
style: {
|
|
@@ -1221,13 +1313,13 @@ function nt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1221
1313
|
}
|
|
1222
1314
|
}) : null;
|
|
1223
1315
|
}
|
|
1224
|
-
function
|
|
1225
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1316
|
+
function ft({ slides: e = [], linked: t, ...n }) {
|
|
1317
|
+
return e.length ? /* @__PURE__ */ d(lt, {
|
|
1226
1318
|
...n,
|
|
1227
1319
|
count: e.length,
|
|
1228
1320
|
renderSlide: (n) => {
|
|
1229
1321
|
let r = e[n];
|
|
1230
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1322
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: ut(r.image, r.color) }), /* @__PURE__ */ d("div", {
|
|
1231
1323
|
style: {
|
|
1232
1324
|
position: "absolute",
|
|
1233
1325
|
inset: 0,
|
|
@@ -1239,7 +1331,7 @@ function rt({ slides: e = [], linked: t, ...n }) {
|
|
|
1239
1331
|
}
|
|
1240
1332
|
}) : null;
|
|
1241
1333
|
}
|
|
1242
|
-
function
|
|
1334
|
+
function pt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lightbox: i = !0, style: o, nodeRef: s, inert: c }) {
|
|
1243
1335
|
let p = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], m = Math.max(0, Number(n) || 0), h = c ? (e) => e.preventDefault() : void 0, [g, _] = l(null), v = i && !c && g !== null && p[g];
|
|
1244
1336
|
a(() => {
|
|
1245
1337
|
if (!v) return;
|
|
@@ -1264,7 +1356,7 @@ function it({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1264
1356
|
columnCount: Math.min(Math.max(Number(t) || 3, 1), 8),
|
|
1265
1357
|
columnGap: m,
|
|
1266
1358
|
width: "100%",
|
|
1267
|
-
...
|
|
1359
|
+
...P(o)
|
|
1268
1360
|
},
|
|
1269
1361
|
children: [
|
|
1270
1362
|
p.map((e, t) => {
|
|
@@ -1438,45 +1530,136 @@ function it({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1438
1530
|
]
|
|
1439
1531
|
});
|
|
1440
1532
|
}
|
|
1441
|
-
var
|
|
1533
|
+
var mt = {
|
|
1442
1534
|
color: "inherit",
|
|
1443
1535
|
textDecoration: "none",
|
|
1444
1536
|
fontSize: 14,
|
|
1445
1537
|
opacity: .85
|
|
1446
|
-
},
|
|
1538
|
+
}, ht = {
|
|
1447
1539
|
background: "var(--page-surface, #f2f2f2)",
|
|
1448
1540
|
color: "var(--page-text, #111827)",
|
|
1449
1541
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
1450
1542
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1451
1543
|
zIndex: 60
|
|
1452
1544
|
};
|
|
1453
|
-
function
|
|
1454
|
-
let
|
|
1545
|
+
function gt(e, t = {}, n = "dropdown") {
|
|
1546
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], i = (e) => Array.isArray(e) ? e[0] : e, a = (e) => e == null ? "" : J(e), o = r.map((e) => {
|
|
1547
|
+
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
1548
|
+
return {
|
|
1549
|
+
key: e.id,
|
|
1550
|
+
parent: (r && typeof r == "object" ? r.id : r) || null,
|
|
1551
|
+
label: a(n[t.labelField || "name"]) || a(n.name) || "Untitled",
|
|
1552
|
+
href: t.hrefField ? a(n[t.hrefField]) : "",
|
|
1553
|
+
image: t.imageField && i(n[t.imageField]) || "",
|
|
1554
|
+
desc: t.descField ? a(n[t.descField]) : ""
|
|
1555
|
+
};
|
|
1556
|
+
}), s = new Map(o.map((e) => [e.key, e])), c = (e) => {
|
|
1557
|
+
let t = /* @__PURE__ */ new Set(), n = e;
|
|
1558
|
+
for (; n.parent && s.has(n.parent) && !t.has(n.key);) t.add(n.key), n = s.get(n.parent);
|
|
1559
|
+
return n;
|
|
1560
|
+
}, l = [], u = /* @__PURE__ */ new Map();
|
|
1561
|
+
for (let e of o) {
|
|
1562
|
+
if (c(e) !== e) continue;
|
|
1563
|
+
let t = {
|
|
1564
|
+
key: e.key,
|
|
1565
|
+
label: e.label,
|
|
1566
|
+
href: e.href,
|
|
1567
|
+
image: e.image,
|
|
1568
|
+
children: []
|
|
1569
|
+
};
|
|
1570
|
+
u.set(e.key, t), l.push(t);
|
|
1571
|
+
}
|
|
1572
|
+
for (let e of o) {
|
|
1573
|
+
let t = c(e);
|
|
1574
|
+
t !== e && u.get(t.key)?.children.push({
|
|
1575
|
+
key: e.key,
|
|
1576
|
+
label: e.label,
|
|
1577
|
+
href: e.href,
|
|
1578
|
+
image: e.image,
|
|
1579
|
+
desc: e.desc
|
|
1580
|
+
});
|
|
1581
|
+
}
|
|
1582
|
+
return l.map((e) => ({
|
|
1583
|
+
...e,
|
|
1584
|
+
type: e.children.length ? n : "link"
|
|
1585
|
+
}));
|
|
1586
|
+
}
|
|
1587
|
+
function _t({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], style: c, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
|
|
1588
|
+
let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(K), N = i(q)?.[g], [F, I] = l(null);
|
|
1455
1589
|
a(() => {
|
|
1456
|
-
if (!
|
|
1457
|
-
let e =
|
|
1458
|
-
return
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1590
|
+
if (!g || N) return;
|
|
1591
|
+
let e = !0;
|
|
1592
|
+
return fetch(`${M}/dynamic/${encodeURIComponent(g)}`, { headers: j ? { "x-tenant": j } : {} }).then((e) => e.json()).then((t) => {
|
|
1593
|
+
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
1594
|
+
e && I(n);
|
|
1595
|
+
}).catch(() => e && I([])), () => {
|
|
1596
|
+
e = !1;
|
|
1597
|
+
};
|
|
1598
|
+
}, [
|
|
1599
|
+
g,
|
|
1600
|
+
j,
|
|
1601
|
+
M,
|
|
1602
|
+
N
|
|
1603
|
+
]), a(() => {
|
|
1604
|
+
if (!C) return;
|
|
1605
|
+
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
1606
|
+
return e.observe(C), () => e.disconnect();
|
|
1607
|
+
}, [C, h]);
|
|
1608
|
+
let L = g ? gt(N ?? F ?? [], {
|
|
1609
|
+
labelField: _,
|
|
1610
|
+
hrefField: v,
|
|
1611
|
+
imageField: y,
|
|
1612
|
+
descField: b,
|
|
1613
|
+
parentField: x
|
|
1614
|
+
}, S) : s, R = m === "hamburger" || m === "auto" && T, z = (e, t, n = !1) => {
|
|
1615
|
+
let r = e.image ? /* @__PURE__ */ d("img", {
|
|
1616
|
+
src: e.image,
|
|
1617
|
+
alt: "",
|
|
1618
|
+
style: n ? {
|
|
1619
|
+
width: "100%",
|
|
1620
|
+
aspectRatio: "16 / 9",
|
|
1621
|
+
objectFit: "cover",
|
|
1622
|
+
borderRadius: 6,
|
|
1623
|
+
display: "block",
|
|
1624
|
+
marginBottom: 8
|
|
1625
|
+
} : {
|
|
1626
|
+
width: 22,
|
|
1627
|
+
height: 22,
|
|
1628
|
+
objectFit: "cover",
|
|
1629
|
+
borderRadius: 4,
|
|
1469
1630
|
display: "block",
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1631
|
+
flexShrink: 0
|
|
1632
|
+
}
|
|
1633
|
+
}) : null;
|
|
1634
|
+
return /* @__PURE__ */ f("a", {
|
|
1635
|
+
href: e.href || "#",
|
|
1636
|
+
style: {
|
|
1637
|
+
...mt,
|
|
1638
|
+
display: n ? "block" : "flex",
|
|
1639
|
+
alignItems: n ? void 0 : "center",
|
|
1640
|
+
gap: n ? void 0 : 10,
|
|
1641
|
+
...t
|
|
1473
1642
|
},
|
|
1474
|
-
children:
|
|
1475
|
-
|
|
1476
|
-
|
|
1643
|
+
children: [r, /* @__PURE__ */ f("span", {
|
|
1644
|
+
style: {
|
|
1645
|
+
display: "block",
|
|
1646
|
+
minWidth: 0
|
|
1647
|
+
},
|
|
1648
|
+
children: [e.label, e.desc && /* @__PURE__ */ d("span", {
|
|
1649
|
+
style: {
|
|
1650
|
+
display: "block",
|
|
1651
|
+
fontSize: 12,
|
|
1652
|
+
opacity: .6,
|
|
1653
|
+
marginTop: 2
|
|
1654
|
+
},
|
|
1655
|
+
children: e.desc
|
|
1656
|
+
})]
|
|
1657
|
+
})]
|
|
1658
|
+
}, e.key);
|
|
1659
|
+
};
|
|
1477
1660
|
return /* @__PURE__ */ f("nav", {
|
|
1478
1661
|
ref: (e) => {
|
|
1479
|
-
|
|
1662
|
+
w(e), p && p(e);
|
|
1480
1663
|
},
|
|
1481
1664
|
style: {
|
|
1482
1665
|
display: "flex",
|
|
@@ -1486,7 +1669,7 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1486
1669
|
padding: "14px 24px",
|
|
1487
1670
|
width: "100%",
|
|
1488
1671
|
position: "relative",
|
|
1489
|
-
...
|
|
1672
|
+
...P(c)
|
|
1490
1673
|
},
|
|
1491
1674
|
children: [
|
|
1492
1675
|
(n || e) && (() => {
|
|
@@ -1504,7 +1687,7 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1504
1687
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
1505
1688
|
},
|
|
1506
1689
|
children: e
|
|
1507
|
-
})] }),
|
|
1690
|
+
})] }), i = {
|
|
1508
1691
|
display: "flex",
|
|
1509
1692
|
alignItems: "center",
|
|
1510
1693
|
gap: 10,
|
|
@@ -1513,20 +1696,20 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1513
1696
|
};
|
|
1514
1697
|
return r ? /* @__PURE__ */ d("a", {
|
|
1515
1698
|
href: r,
|
|
1516
|
-
target:
|
|
1517
|
-
rel:
|
|
1518
|
-
style:
|
|
1699
|
+
target: o || void 0,
|
|
1700
|
+
rel: o === "_blank" ? "noopener noreferrer" : void 0,
|
|
1701
|
+
style: i,
|
|
1519
1702
|
children: t
|
|
1520
1703
|
}) : /* @__PURE__ */ d("div", {
|
|
1521
|
-
style:
|
|
1704
|
+
style: i,
|
|
1522
1705
|
children: t
|
|
1523
1706
|
});
|
|
1524
1707
|
})(),
|
|
1525
1708
|
/* @__PURE__ */ d("div", { style: { flexGrow: 1 } }),
|
|
1526
|
-
|
|
1709
|
+
R ? /* @__PURE__ */ d("button", {
|
|
1527
1710
|
type: "button",
|
|
1528
|
-
"aria-label":
|
|
1529
|
-
onClick: () =>
|
|
1711
|
+
"aria-label": D ? "Close menu" : "Open menu",
|
|
1712
|
+
onClick: () => O(!D),
|
|
1530
1713
|
style: {
|
|
1531
1714
|
background: "transparent",
|
|
1532
1715
|
border: 0,
|
|
@@ -1536,7 +1719,7 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1536
1719
|
lineHeight: 1,
|
|
1537
1720
|
padding: 4
|
|
1538
1721
|
},
|
|
1539
|
-
children:
|
|
1722
|
+
children: D ? "✕" : "☰"
|
|
1540
1723
|
}) : /* @__PURE__ */ d("div", {
|
|
1541
1724
|
style: {
|
|
1542
1725
|
display: "flex",
|
|
@@ -1544,11 +1727,11 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1544
1727
|
alignItems: "center",
|
|
1545
1728
|
flexWrap: "wrap"
|
|
1546
1729
|
},
|
|
1547
|
-
children:
|
|
1730
|
+
children: L.map((e) => {
|
|
1548
1731
|
let t = e.children ?? [];
|
|
1549
1732
|
if (!t.length) return /* @__PURE__ */ d("a", {
|
|
1550
1733
|
href: e.href || "#",
|
|
1551
|
-
style:
|
|
1734
|
+
style: mt,
|
|
1552
1735
|
children: e.label
|
|
1553
1736
|
}, e.key);
|
|
1554
1737
|
let n = e.type === "mega";
|
|
@@ -1557,12 +1740,12 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1557
1740
|
position: n ? "static" : "relative",
|
|
1558
1741
|
display: "inline-flex"
|
|
1559
1742
|
},
|
|
1560
|
-
onMouseEnter: () =>
|
|
1561
|
-
onMouseLeave: () =>
|
|
1743
|
+
onMouseEnter: () => A(e.key),
|
|
1744
|
+
onMouseLeave: () => A(null),
|
|
1562
1745
|
children: [/* @__PURE__ */ f("a", {
|
|
1563
1746
|
href: e.href || "#",
|
|
1564
1747
|
style: {
|
|
1565
|
-
...
|
|
1748
|
+
...mt,
|
|
1566
1749
|
cursor: "pointer"
|
|
1567
1750
|
},
|
|
1568
1751
|
children: [
|
|
@@ -1576,9 +1759,9 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1576
1759
|
children: "▼"
|
|
1577
1760
|
})
|
|
1578
1761
|
]
|
|
1579
|
-
}),
|
|
1762
|
+
}), k === e.key && (n ? /* @__PURE__ */ d("div", {
|
|
1580
1763
|
style: {
|
|
1581
|
-
...
|
|
1764
|
+
...ht,
|
|
1582
1765
|
position: "absolute",
|
|
1583
1766
|
left: 0,
|
|
1584
1767
|
right: 0,
|
|
@@ -1588,13 +1771,13 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1588
1771
|
gridTemplateColumns: "repeat(auto-fit, minmax(170px, 1fr))",
|
|
1589
1772
|
gap: 16
|
|
1590
1773
|
},
|
|
1591
|
-
children: t.map((e) =>
|
|
1592
|
-
padding:
|
|
1593
|
-
borderRadius:
|
|
1594
|
-
}))
|
|
1774
|
+
children: t.map((e) => z(e, {
|
|
1775
|
+
padding: 8,
|
|
1776
|
+
borderRadius: 8
|
|
1777
|
+
}, !0))
|
|
1595
1778
|
}) : /* @__PURE__ */ d("div", {
|
|
1596
1779
|
style: {
|
|
1597
|
-
...
|
|
1780
|
+
...ht,
|
|
1598
1781
|
position: "absolute",
|
|
1599
1782
|
top: "100%",
|
|
1600
1783
|
left: 0,
|
|
@@ -1604,7 +1787,7 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1604
1787
|
display: "flex",
|
|
1605
1788
|
flexDirection: "column"
|
|
1606
1789
|
},
|
|
1607
|
-
children: t.map((e) =>
|
|
1790
|
+
children: t.map((e) => z(e, {
|
|
1608
1791
|
padding: "8px 12px",
|
|
1609
1792
|
borderRadius: 6
|
|
1610
1793
|
}))
|
|
@@ -1612,7 +1795,7 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1612
1795
|
}, e.key);
|
|
1613
1796
|
})
|
|
1614
1797
|
}),
|
|
1615
|
-
|
|
1798
|
+
R && D && /* @__PURE__ */ d("div", {
|
|
1616
1799
|
style: {
|
|
1617
1800
|
flexBasis: "100%",
|
|
1618
1801
|
width: "100%",
|
|
@@ -1620,27 +1803,27 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1620
1803
|
flexDirection: "column",
|
|
1621
1804
|
paddingTop: 10
|
|
1622
1805
|
},
|
|
1623
|
-
children:
|
|
1806
|
+
children: L.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
|
|
1624
1807
|
href: e.href || "#",
|
|
1625
1808
|
style: {
|
|
1626
|
-
...
|
|
1809
|
+
...mt,
|
|
1627
1810
|
padding: "10px 4px",
|
|
1628
1811
|
fontWeight: (e.children ?? []).length ? 600 : 400,
|
|
1629
1812
|
opacity: 1
|
|
1630
1813
|
},
|
|
1631
1814
|
children: e.label
|
|
1632
|
-
}), (e.children ?? []).map((e) =>
|
|
1815
|
+
}), (e.children ?? []).map((e) => z(e, { padding: "8px 4px 8px 22px" }))] }, e.key))
|
|
1633
1816
|
})
|
|
1634
1817
|
]
|
|
1635
1818
|
});
|
|
1636
1819
|
}
|
|
1637
|
-
function
|
|
1820
|
+
function vt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
1638
1821
|
let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
1639
1822
|
return e.length ? /* @__PURE__ */ f("div", {
|
|
1640
1823
|
ref: r,
|
|
1641
1824
|
style: {
|
|
1642
1825
|
width: "100%",
|
|
1643
|
-
...
|
|
1826
|
+
...P(n)
|
|
1644
1827
|
},
|
|
1645
1828
|
children: [/* @__PURE__ */ d("div", {
|
|
1646
1829
|
style: {
|
|
@@ -1674,7 +1857,7 @@ function ct({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
1674
1857
|
}, e.key))]
|
|
1675
1858
|
}) : null;
|
|
1676
1859
|
}
|
|
1677
|
-
function
|
|
1860
|
+
function yt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
|
|
1678
1861
|
let [a, o] = l(() => new Set(e.length ? [e[0].key] : []));
|
|
1679
1862
|
if (!e.length) return null;
|
|
1680
1863
|
let s = (e) => o((t) => {
|
|
@@ -1685,7 +1868,7 @@ function lt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1685
1868
|
ref: i,
|
|
1686
1869
|
style: {
|
|
1687
1870
|
width: "100%",
|
|
1688
|
-
...
|
|
1871
|
+
...P(r)
|
|
1689
1872
|
},
|
|
1690
1873
|
children: e.map((n, r) => {
|
|
1691
1874
|
let i = a.has(n.key);
|
|
@@ -1731,15 +1914,15 @@ function lt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1731
1914
|
})
|
|
1732
1915
|
});
|
|
1733
1916
|
}
|
|
1734
|
-
var
|
|
1917
|
+
var bt = {
|
|
1735
1918
|
display: "flex",
|
|
1736
1919
|
flexDirection: "column",
|
|
1737
1920
|
gap: "12px"
|
|
1738
|
-
},
|
|
1921
|
+
}, Z = {
|
|
1739
1922
|
fontSize: "14px",
|
|
1740
1923
|
fontWeight: 500,
|
|
1741
1924
|
color: "var(--page-text, #111827)"
|
|
1742
|
-
},
|
|
1925
|
+
}, Q = {
|
|
1743
1926
|
padding: "10px 12px",
|
|
1744
1927
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
1745
1928
|
borderRadius: "6px",
|
|
@@ -1749,18 +1932,18 @@ var ut = {
|
|
|
1749
1932
|
boxSizing: "border-box",
|
|
1750
1933
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
1751
1934
|
color: "var(--page-text, #111827)"
|
|
1752
|
-
},
|
|
1935
|
+
}, xt = {
|
|
1753
1936
|
display: "flex",
|
|
1754
1937
|
alignItems: "center",
|
|
1755
1938
|
gap: "8px",
|
|
1756
1939
|
fontSize: "14px",
|
|
1757
1940
|
color: "var(--page-text, #111827)"
|
|
1758
|
-
},
|
|
1941
|
+
}, $ = (e) => e ? {
|
|
1759
1942
|
readOnly: !0,
|
|
1760
1943
|
tabIndex: -1,
|
|
1761
1944
|
onMouseDown: (e) => e.preventDefault()
|
|
1762
1945
|
} : {};
|
|
1763
|
-
function
|
|
1946
|
+
function St(e, t) {
|
|
1764
1947
|
if (!e) return !0;
|
|
1765
1948
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
1766
1949
|
switch (e.op) {
|
|
@@ -1774,11 +1957,11 @@ function ft(e, t) {
|
|
|
1774
1957
|
default: return !1;
|
|
1775
1958
|
}
|
|
1776
1959
|
}
|
|
1777
|
-
var
|
|
1960
|
+
var Ct = {
|
|
1778
1961
|
display: "flex",
|
|
1779
1962
|
flexDirection: "column",
|
|
1780
1963
|
gap: 6
|
|
1781
|
-
},
|
|
1964
|
+
}, wt = {
|
|
1782
1965
|
font: "inherit",
|
|
1783
1966
|
fontSize: 15,
|
|
1784
1967
|
padding: "10px 12px",
|
|
@@ -1789,16 +1972,16 @@ var pt = {
|
|
|
1789
1972
|
width: "100%",
|
|
1790
1973
|
boxSizing: "border-box"
|
|
1791
1974
|
};
|
|
1792
|
-
function
|
|
1975
|
+
function Tt(e, t) {
|
|
1793
1976
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
1794
1977
|
if (!e?.parentField) return n;
|
|
1795
1978
|
let r = t?.[e.parentField];
|
|
1796
1979
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
1797
1980
|
}
|
|
1798
|
-
function
|
|
1981
|
+
function Et({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
1799
1982
|
let a = /* @__PURE__ */ f("span", {
|
|
1800
1983
|
style: {
|
|
1801
|
-
...
|
|
1984
|
+
...Z,
|
|
1802
1985
|
fontSize: 14
|
|
1803
1986
|
},
|
|
1804
1987
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -1807,7 +1990,7 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1807
1990
|
required: e.required || void 0,
|
|
1808
1991
|
placeholder: e.placeholder || void 0,
|
|
1809
1992
|
disabled: r || void 0,
|
|
1810
|
-
style:
|
|
1993
|
+
style: wt,
|
|
1811
1994
|
value: t ?? "",
|
|
1812
1995
|
onChange: (t) => n(e.name, t.target.value)
|
|
1813
1996
|
};
|
|
@@ -1836,7 +2019,7 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1836
2019
|
borderRadius: 8,
|
|
1837
2020
|
display: "block"
|
|
1838
2021
|
}
|
|
1839
|
-
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(
|
|
2022
|
+
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(tt, {
|
|
1840
2023
|
url: e.src,
|
|
1841
2024
|
style: { width: "100%" }
|
|
1842
2025
|
}) : /* @__PURE__ */ d("video", {
|
|
@@ -1848,14 +2031,14 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1848
2031
|
display: "block"
|
|
1849
2032
|
}
|
|
1850
2033
|
}) : null : /* @__PURE__ */ f("label", {
|
|
1851
|
-
style:
|
|
2034
|
+
style: Ct,
|
|
1852
2035
|
children: [
|
|
1853
2036
|
a,
|
|
1854
2037
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
|
|
1855
2038
|
...o,
|
|
1856
2039
|
rows: 4,
|
|
1857
2040
|
style: {
|
|
1858
|
-
...
|
|
2041
|
+
...wt,
|
|
1859
2042
|
resize: "vertical"
|
|
1860
2043
|
}
|
|
1861
2044
|
}) : e.type === "select" ? /* @__PURE__ */ f("select", {
|
|
@@ -1864,7 +2047,7 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1864
2047
|
children: [/* @__PURE__ */ d("option", {
|
|
1865
2048
|
value: "",
|
|
1866
2049
|
children: e.placeholder || "—"
|
|
1867
|
-
}),
|
|
2050
|
+
}), Tt(e, i).map((e, t) => /* @__PURE__ */ d("option", {
|
|
1868
2051
|
value: typeof e == "string" ? e : e.value,
|
|
1869
2052
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
1870
2053
|
}, t))]
|
|
@@ -1911,8 +2094,8 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1911
2094
|
]
|
|
1912
2095
|
});
|
|
1913
2096
|
}
|
|
1914
|
-
function
|
|
1915
|
-
let { tenant: y, apiUrl: b } = i(
|
|
2097
|
+
function Dt({ 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 }) {
|
|
2098
|
+
let { tenant: y, apiUrl: b } = i(K), [x, S] = l("form"), [C, w] = l(null), [T, E] = l({}), [D, O] = l(0), k = h ? v || "form" : x;
|
|
1916
2099
|
a(() => {
|
|
1917
2100
|
if (!c || !s) return;
|
|
1918
2101
|
let e = !0;
|
|
@@ -1925,21 +2108,21 @@ function _t({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1925
2108
|
y,
|
|
1926
2109
|
b
|
|
1927
2110
|
]);
|
|
1928
|
-
let
|
|
2111
|
+
let A = [{
|
|
1929
2112
|
section: null,
|
|
1930
2113
|
fields: []
|
|
1931
2114
|
}];
|
|
1932
|
-
for (let e of Array.isArray(C?.fields) ? C.fields : []) e.type === "section" ?
|
|
2115
|
+
for (let e of Array.isArray(C?.fields) ? C.fields : []) e.type === "section" ? A.push({
|
|
1933
2116
|
section: e,
|
|
1934
2117
|
fields: []
|
|
1935
|
-
}) :
|
|
1936
|
-
let
|
|
2118
|
+
}) : A[A.length - 1].fields.push(e);
|
|
2119
|
+
let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section || St(e.section.condition, T)).map((e) => ({
|
|
1937
2120
|
...e,
|
|
1938
|
-
fields: e.fields.filter((e) =>
|
|
1939
|
-
})),
|
|
2121
|
+
fields: e.fields.filter((e) => St(e.condition, T))
|
|
2122
|
+
})), N = j.length > 1, F = Math.min(D, Math.max(0, M.length - 1)), I = N ? M[F]?.fields ?? [] : M.flatMap((e) => e.fields), L = I.filter((e) => {
|
|
1940
2123
|
let t = T[e.name];
|
|
1941
2124
|
return e.required && (t == null || t === "" || t === !1);
|
|
1942
|
-
}),
|
|
2125
|
+
}), R = F >= M.length - 1, z = (e, t) => E((n) => {
|
|
1943
2126
|
let r = {
|
|
1944
2127
|
...n,
|
|
1945
2128
|
[e]: t
|
|
@@ -1949,7 +2132,7 @@ function _t({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1949
2132
|
});
|
|
1950
2133
|
return /* @__PURE__ */ f("div", {
|
|
1951
2134
|
ref: m,
|
|
1952
|
-
style:
|
|
2135
|
+
style: P(e),
|
|
1953
2136
|
children: [
|
|
1954
2137
|
/* @__PURE__ */ d("form", {
|
|
1955
2138
|
action: t || void 0,
|
|
@@ -1993,28 +2176,28 @@ function _t({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1993
2176
|
}
|
|
1994
2177
|
},
|
|
1995
2178
|
style: {
|
|
1996
|
-
...
|
|
1997
|
-
display:
|
|
2179
|
+
...bt,
|
|
2180
|
+
display: k === "success" ? "none" : "flex"
|
|
1998
2181
|
},
|
|
1999
2182
|
children: c && s ? /* @__PURE__ */ f(u, { children: [
|
|
2000
|
-
|
|
2001
|
-
steps:
|
|
2183
|
+
N && /* @__PURE__ */ d(tn, {
|
|
2184
|
+
steps: M.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2002
2185
|
active: F + 1,
|
|
2003
2186
|
style: { marginBottom: 8 }
|
|
2004
2187
|
}),
|
|
2005
|
-
|
|
2188
|
+
N && M[F]?.section?.help && /* @__PURE__ */ d("p", {
|
|
2006
2189
|
style: {
|
|
2007
2190
|
margin: 0,
|
|
2008
2191
|
fontSize: 14,
|
|
2009
2192
|
opacity: .7
|
|
2010
2193
|
},
|
|
2011
|
-
children:
|
|
2194
|
+
children: M[F].section.help
|
|
2012
2195
|
}),
|
|
2013
|
-
|
|
2196
|
+
I.map((e) => /* @__PURE__ */ d(Et, {
|
|
2014
2197
|
field: e,
|
|
2015
2198
|
value: T[e.name],
|
|
2016
2199
|
values: T,
|
|
2017
|
-
onChange:
|
|
2200
|
+
onChange: z,
|
|
2018
2201
|
inert: h
|
|
2019
2202
|
}, e.name)),
|
|
2020
2203
|
/* @__PURE__ */ f("div", {
|
|
@@ -2024,12 +2207,12 @@ function _t({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2024
2207
|
alignItems: "center",
|
|
2025
2208
|
marginTop: 4
|
|
2026
2209
|
},
|
|
2027
|
-
children: [
|
|
2210
|
+
children: [N && F > 0 && /* @__PURE__ */ d("button", {
|
|
2028
2211
|
type: "button",
|
|
2029
2212
|
disabled: h || void 0,
|
|
2030
|
-
onClick: () =>
|
|
2213
|
+
onClick: () => O(F - 1),
|
|
2031
2214
|
style: {
|
|
2032
|
-
...
|
|
2215
|
+
...Y,
|
|
2033
2216
|
background: "transparent",
|
|
2034
2217
|
color: "inherit",
|
|
2035
2218
|
border: 0,
|
|
@@ -2037,26 +2220,26 @@ function _t({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2037
2220
|
cursor: "pointer"
|
|
2038
2221
|
},
|
|
2039
2222
|
children: "Back"
|
|
2040
|
-
}),
|
|
2223
|
+
}), N && !R ? /* @__PURE__ */ d("button", {
|
|
2041
2224
|
type: "button",
|
|
2042
|
-
disabled: h ||
|
|
2043
|
-
onClick: () =>
|
|
2225
|
+
disabled: h || L.length > 0,
|
|
2226
|
+
onClick: () => O(F + 1),
|
|
2044
2227
|
style: {
|
|
2045
|
-
...
|
|
2228
|
+
...Y,
|
|
2046
2229
|
border: 0,
|
|
2047
2230
|
padding: "10px 22px",
|
|
2048
2231
|
borderRadius: 8,
|
|
2049
2232
|
fontSize: 15,
|
|
2050
2233
|
fontWeight: 600,
|
|
2051
2234
|
cursor: "pointer",
|
|
2052
|
-
opacity:
|
|
2235
|
+
opacity: L.length ? .5 : 1
|
|
2053
2236
|
},
|
|
2054
2237
|
children: "Next"
|
|
2055
2238
|
}) : /* @__PURE__ */ d("button", {
|
|
2056
2239
|
type: "submit",
|
|
2057
2240
|
disabled: h || void 0,
|
|
2058
2241
|
style: {
|
|
2059
|
-
...
|
|
2242
|
+
...Y,
|
|
2060
2243
|
border: 0,
|
|
2061
2244
|
padding: "10px 22px",
|
|
2062
2245
|
borderRadius: 8,
|
|
@@ -2070,12 +2253,12 @@ function _t({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2070
2253
|
] }) : g
|
|
2071
2254
|
}),
|
|
2072
2255
|
/* @__PURE__ */ d("div", {
|
|
2073
|
-
style: { display:
|
|
2256
|
+
style: { display: k === "success" ? "block" : "none" },
|
|
2074
2257
|
children: _?.success ?? null
|
|
2075
2258
|
}),
|
|
2076
2259
|
/* @__PURE__ */ d("div", {
|
|
2077
2260
|
style: {
|
|
2078
|
-
display:
|
|
2261
|
+
display: k === "error" ? "block" : "none",
|
|
2079
2262
|
marginTop: 12
|
|
2080
2263
|
},
|
|
2081
2264
|
children: _?.error ?? null
|
|
@@ -2083,10 +2266,10 @@ function _t({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2083
2266
|
]
|
|
2084
2267
|
});
|
|
2085
2268
|
}
|
|
2086
|
-
var
|
|
2269
|
+
var Ot = null, kt = null, At = (e) => {
|
|
2087
2270
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2088
|
-
if (
|
|
2089
|
-
if (
|
|
2271
|
+
if (Ot && kt === t) return Ot;
|
|
2272
|
+
if (Ot && typeof window < "u") {
|
|
2090
2273
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2091
2274
|
delete window[e];
|
|
2092
2275
|
} catch {
|
|
@@ -2094,22 +2277,22 @@ var X = null, vt = null, yt = (e) => {
|
|
|
2094
2277
|
}
|
|
2095
2278
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2096
2279
|
}
|
|
2097
|
-
return
|
|
2280
|
+
return kt = t, Ot = new Promise((e) => {
|
|
2098
2281
|
if (typeof window > "u") return;
|
|
2099
2282
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2100
2283
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2101
2284
|
let n = document.createElement("script");
|
|
2102
2285
|
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
2103
|
-
}),
|
|
2286
|
+
}), Ot;
|
|
2104
2287
|
};
|
|
2105
|
-
function
|
|
2106
|
-
let p = i(
|
|
2288
|
+
function jt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l, onChange: u }) {
|
|
2289
|
+
let p = i(K), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = c(null), _ = c(u);
|
|
2107
2290
|
if (_.current = u, a(() => {
|
|
2108
2291
|
if (l || !h || !g.current) return;
|
|
2109
2292
|
let e = !0, i = (t) => {
|
|
2110
2293
|
e && typeof _.current == "function" && _.current(t);
|
|
2111
2294
|
};
|
|
2112
|
-
return
|
|
2295
|
+
return At(r).then((r) => {
|
|
2113
2296
|
if (!(!e || !g.current || !r?.render)) {
|
|
2114
2297
|
g.current.innerHTML = "", i("");
|
|
2115
2298
|
try {
|
|
@@ -2136,7 +2319,7 @@ function bt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert:
|
|
|
2136
2319
|
let e = t === "dark";
|
|
2137
2320
|
return /* @__PURE__ */ f("div", {
|
|
2138
2321
|
ref: s,
|
|
2139
|
-
style:
|
|
2322
|
+
style: P(o),
|
|
2140
2323
|
children: [/* @__PURE__ */ f("div", {
|
|
2141
2324
|
style: {
|
|
2142
2325
|
width: n === "compact" ? 164 : 302,
|
|
@@ -2187,21 +2370,21 @@ function bt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert:
|
|
|
2187
2370
|
}
|
|
2188
2371
|
return h ? /* @__PURE__ */ d("div", {
|
|
2189
2372
|
ref: s,
|
|
2190
|
-
style:
|
|
2373
|
+
style: P(o),
|
|
2191
2374
|
children: /* @__PURE__ */ d("div", { ref: g })
|
|
2192
2375
|
}) : null;
|
|
2193
2376
|
}
|
|
2194
|
-
function
|
|
2377
|
+
function Mt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2195
2378
|
return /* @__PURE__ */ d("label", {
|
|
2196
2379
|
ref: r,
|
|
2197
2380
|
style: {
|
|
2198
|
-
...
|
|
2199
|
-
...
|
|
2381
|
+
...Z,
|
|
2382
|
+
...P(n)
|
|
2200
2383
|
},
|
|
2201
|
-
children:
|
|
2384
|
+
children: X(t, e, i)
|
|
2202
2385
|
});
|
|
2203
2386
|
}
|
|
2204
|
-
function
|
|
2387
|
+
function Nt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2205
2388
|
return /* @__PURE__ */ d("input", {
|
|
2206
2389
|
ref: a,
|
|
2207
2390
|
type: e,
|
|
@@ -2209,13 +2392,13 @@ function St({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2209
2392
|
placeholder: n,
|
|
2210
2393
|
required: !o && !!r,
|
|
2211
2394
|
style: {
|
|
2212
|
-
...
|
|
2213
|
-
...
|
|
2395
|
+
...Q,
|
|
2396
|
+
...P(i)
|
|
2214
2397
|
},
|
|
2215
|
-
|
|
2398
|
+
...$(o)
|
|
2216
2399
|
});
|
|
2217
2400
|
}
|
|
2218
|
-
function
|
|
2401
|
+
function Pt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2219
2402
|
return /* @__PURE__ */ d("textarea", {
|
|
2220
2403
|
ref: a,
|
|
2221
2404
|
name: e || void 0,
|
|
@@ -2223,19 +2406,19 @@ function Ct({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2223
2406
|
rows: n,
|
|
2224
2407
|
required: !o && !!r,
|
|
2225
2408
|
style: {
|
|
2226
|
-
...
|
|
2409
|
+
...Q,
|
|
2227
2410
|
resize: "vertical",
|
|
2228
|
-
...
|
|
2411
|
+
...P(i)
|
|
2229
2412
|
},
|
|
2230
|
-
|
|
2413
|
+
...$(o)
|
|
2231
2414
|
});
|
|
2232
2415
|
}
|
|
2233
|
-
function
|
|
2416
|
+
function Ft({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2234
2417
|
return /* @__PURE__ */ f("label", {
|
|
2235
2418
|
ref: o,
|
|
2236
2419
|
style: {
|
|
2237
|
-
...
|
|
2238
|
-
...
|
|
2420
|
+
...xt,
|
|
2421
|
+
...P(a)
|
|
2239
2422
|
},
|
|
2240
2423
|
children: [/* @__PURE__ */ d("input", {
|
|
2241
2424
|
type: e,
|
|
@@ -2251,7 +2434,7 @@ function wt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
2251
2434
|
}), t]
|
|
2252
2435
|
});
|
|
2253
2436
|
}
|
|
2254
|
-
function
|
|
2437
|
+
function It({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
2255
2438
|
return /* @__PURE__ */ f("select", {
|
|
2256
2439
|
ref: a,
|
|
2257
2440
|
name: e || void 0,
|
|
@@ -2260,9 +2443,9 @@ function Tt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2260
2443
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
2261
2444
|
tabIndex: o ? -1 : void 0,
|
|
2262
2445
|
style: {
|
|
2263
|
-
...
|
|
2446
|
+
...Q,
|
|
2264
2447
|
appearance: "auto",
|
|
2265
|
-
...
|
|
2448
|
+
...P(i)
|
|
2266
2449
|
},
|
|
2267
2450
|
children: [t !== "" && /* @__PURE__ */ d("option", {
|
|
2268
2451
|
value: "",
|
|
@@ -2274,19 +2457,19 @@ function Tt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2274
2457
|
}, t))]
|
|
2275
2458
|
});
|
|
2276
2459
|
}
|
|
2277
|
-
function
|
|
2460
|
+
function Lt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
2278
2461
|
let [s, c] = l(null);
|
|
2279
2462
|
return /* @__PURE__ */ f("label", {
|
|
2280
2463
|
ref: a,
|
|
2281
2464
|
style: {
|
|
2282
|
-
...
|
|
2465
|
+
...Q,
|
|
2283
2466
|
display: "flex",
|
|
2284
2467
|
alignItems: "center",
|
|
2285
2468
|
gap: "8px",
|
|
2286
2469
|
cursor: o ? "default" : "pointer",
|
|
2287
2470
|
borderStyle: "dashed",
|
|
2288
2471
|
color: s ? "#111827" : "#6b7280",
|
|
2289
|
-
...
|
|
2472
|
+
...P(i)
|
|
2290
2473
|
},
|
|
2291
2474
|
children: [
|
|
2292
2475
|
/* @__PURE__ */ d("input", {
|
|
@@ -2306,12 +2489,12 @@ function Et({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
2306
2489
|
]
|
|
2307
2490
|
});
|
|
2308
2491
|
}
|
|
2309
|
-
function
|
|
2492
|
+
function Rt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
2310
2493
|
return /* @__PURE__ */ d("button", {
|
|
2311
2494
|
ref: n,
|
|
2312
2495
|
type: r ? "button" : "submit",
|
|
2313
2496
|
style: {
|
|
2314
|
-
...
|
|
2497
|
+
...Y,
|
|
2315
2498
|
border: 0,
|
|
2316
2499
|
cursor: "pointer",
|
|
2317
2500
|
alignSelf: "flex-start",
|
|
@@ -2321,12 +2504,12 @@ function Dt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
2321
2504
|
fontWeight: 600,
|
|
2322
2505
|
lineHeight: 1.4,
|
|
2323
2506
|
fontFamily: "inherit",
|
|
2324
|
-
...
|
|
2507
|
+
...P(t)
|
|
2325
2508
|
},
|
|
2326
2509
|
children: e
|
|
2327
2510
|
});
|
|
2328
2511
|
}
|
|
2329
|
-
function
|
|
2512
|
+
function zt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
2330
2513
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
2331
2514
|
return /* @__PURE__ */ d("div", {
|
|
2332
2515
|
ref: r,
|
|
@@ -2335,7 +2518,7 @@ function Ot({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2335
2518
|
gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
|
|
2336
2519
|
gap: 16,
|
|
2337
2520
|
width: "100%",
|
|
2338
|
-
...
|
|
2521
|
+
...P(n)
|
|
2339
2522
|
},
|
|
2340
2523
|
children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ d("div", {
|
|
2341
2524
|
style: { minWidth: 0 },
|
|
@@ -2343,8 +2526,8 @@ function Ot({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2343
2526
|
}, t))
|
|
2344
2527
|
});
|
|
2345
2528
|
}
|
|
2346
|
-
function
|
|
2347
|
-
let { tenant: v, apiUrl: y, locale: b } = i(
|
|
2529
|
+
function Bt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
|
|
2530
|
+
let { tenant: v, apiUrl: y, locale: b } = i(K), x = i(Ce), S = i(q), [, C] = l(0);
|
|
2348
2531
|
a(() => {
|
|
2349
2532
|
if (typeof window > "u") return;
|
|
2350
2533
|
let e = () => C((e) => e + 1);
|
|
@@ -2352,19 +2535,19 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2352
2535
|
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
2353
2536
|
};
|
|
2354
2537
|
}, []);
|
|
2355
|
-
let w =
|
|
2538
|
+
let w = Se(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? be(S) : 1, [k, A] = l(null);
|
|
2356
2539
|
if (a(() => {
|
|
2357
|
-
if (!e ||
|
|
2540
|
+
if (!e || D) return;
|
|
2358
2541
|
let n = !0, r = new URLSearchParams();
|
|
2359
2542
|
if (b && r.set("locale", b), E && r.set("data_filter", T), m && !e.startsWith("api:")) {
|
|
2360
2543
|
let e = Math.max(1, Number(t) || 6);
|
|
2361
|
-
r.set("offset", String((
|
|
2544
|
+
r.set("offset", String((O - 1) * e)), r.set("limit", String(e));
|
|
2362
2545
|
}
|
|
2363
2546
|
let i = r.toString(), a = e.startsWith("api:") ? `${y}/data/${encodeURIComponent(e.slice(4))}` : `${y}/dynamic/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
|
|
2364
2547
|
return fetch(a, { headers: v ? { "x-tenant": v } : {} }).then((e) => e.json()).then((e) => {
|
|
2365
2548
|
let t = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
|
|
2366
|
-
return n &&
|
|
2367
|
-
}).catch(() => n &&
|
|
2549
|
+
return n && A(t.filter((e) => e && typeof e == "object"));
|
|
2550
|
+
}).catch(() => n && A([])), () => {
|
|
2368
2551
|
n = !1;
|
|
2369
2552
|
};
|
|
2370
2553
|
}, [
|
|
@@ -2372,20 +2555,20 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2372
2555
|
v,
|
|
2373
2556
|
y,
|
|
2374
2557
|
b,
|
|
2375
|
-
|
|
2558
|
+
D,
|
|
2376
2559
|
m,
|
|
2377
|
-
|
|
2560
|
+
O,
|
|
2378
2561
|
t,
|
|
2379
2562
|
E,
|
|
2380
2563
|
T
|
|
2381
2564
|
]), !e) return null;
|
|
2382
|
-
let
|
|
2565
|
+
let j = Math.max(1, Number(t) || 6), M = m ? D || e.startsWith("api:") ? (D ?? k ?? []).slice((O - 1) * j, O * j) : (k ?? []).slice(0, j) : (D ?? k ?? []).slice(0, j), N = Math.min(Math.max(Number(r) || 3, 1), 6), F = n === "list" ? {
|
|
2383
2566
|
display: "flex",
|
|
2384
2567
|
flexDirection: "column",
|
|
2385
2568
|
gap: 20
|
|
2386
2569
|
} : {
|
|
2387
2570
|
display: "grid",
|
|
2388
|
-
gridTemplateColumns: `repeat(${
|
|
2571
|
+
gridTemplateColumns: `repeat(${N}, minmax(0, 1fr))`,
|
|
2389
2572
|
gap: 24
|
|
2390
2573
|
};
|
|
2391
2574
|
return u && p && x?.render ? /* @__PURE__ */ d("div", {
|
|
@@ -2393,21 +2576,21 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2393
2576
|
style: {
|
|
2394
2577
|
width: "100%",
|
|
2395
2578
|
...F,
|
|
2396
|
-
...
|
|
2579
|
+
...P(g)
|
|
2397
2580
|
},
|
|
2398
|
-
children:
|
|
2581
|
+
children: M.map((e) => /* @__PURE__ */ d("div", {
|
|
2399
2582
|
style: { minWidth: 0 },
|
|
2400
|
-
children: x.render(p, (t) =>
|
|
2583
|
+
children: x.render(p, (t) => De(t, e))
|
|
2401
2584
|
}, e.id ?? e?.data?.slug))
|
|
2402
2585
|
}) : /* @__PURE__ */ d("div", {
|
|
2403
2586
|
ref: _,
|
|
2404
2587
|
style: {
|
|
2405
2588
|
width: "100%",
|
|
2406
2589
|
...F,
|
|
2407
|
-
...
|
|
2590
|
+
...P(g)
|
|
2408
2591
|
},
|
|
2409
|
-
children:
|
|
2410
|
-
let t = o ?
|
|
2592
|
+
children: M.map((e) => {
|
|
2593
|
+
let t = o ? Te(e?.data, o) : null, r = s ? J(Te(e?.data, s)) : null, i = c ? Te(e?.data, c) : null, a = Array.isArray(i) ? i : null, l = a || i == null ? null : J(i), u = n === "list";
|
|
2411
2594
|
return /* @__PURE__ */ f("div", {
|
|
2412
2595
|
style: {
|
|
2413
2596
|
display: "flex",
|
|
@@ -2454,7 +2637,7 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2454
2637
|
lineHeight: 1.55,
|
|
2455
2638
|
opacity: .85
|
|
2456
2639
|
},
|
|
2457
|
-
children:
|
|
2640
|
+
children: Ue(a)
|
|
2458
2641
|
})
|
|
2459
2642
|
]
|
|
2460
2643
|
})]
|
|
@@ -2462,8 +2645,8 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2462
2645
|
})
|
|
2463
2646
|
});
|
|
2464
2647
|
}
|
|
2465
|
-
function
|
|
2466
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
2648
|
+
function Vt({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
2649
|
+
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : xe(), s = {
|
|
2467
2650
|
height: 34,
|
|
2468
2651
|
padding: "0 12px",
|
|
2469
2652
|
borderRadius: 8,
|
|
@@ -2505,13 +2688,13 @@ function At({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2505
2688
|
alignItems: "center",
|
|
2506
2689
|
gap: 8,
|
|
2507
2690
|
width: "100%",
|
|
2508
|
-
...
|
|
2691
|
+
...P(n)
|
|
2509
2692
|
},
|
|
2510
2693
|
children: [a.map((e) => Array.isArray(e.options) && e.options.length > 0 || e.type === "option" || e.type === "select" ? /* @__PURE__ */ f("select", {
|
|
2511
2694
|
name: `f_${e.name}`,
|
|
2512
2695
|
defaultValue: o[e.name] ?? "",
|
|
2513
2696
|
style: s,
|
|
2514
|
-
|
|
2697
|
+
...$(i),
|
|
2515
2698
|
children: [/* @__PURE__ */ d("option", {
|
|
2516
2699
|
value: "",
|
|
2517
2700
|
children: e.label || e.name
|
|
@@ -2526,7 +2709,7 @@ function At({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2526
2709
|
name: `f_${e.name}`,
|
|
2527
2710
|
defaultValue: o[e.name] ?? "",
|
|
2528
2711
|
style: s,
|
|
2529
|
-
|
|
2712
|
+
...$(i),
|
|
2530
2713
|
children: [
|
|
2531
2714
|
/* @__PURE__ */ d("option", {
|
|
2532
2715
|
value: "",
|
|
@@ -2547,7 +2730,7 @@ function At({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2547
2730
|
defaultValue: o[e.name] ?? "",
|
|
2548
2731
|
placeholder: e.label || e.name,
|
|
2549
2732
|
style: s,
|
|
2550
|
-
|
|
2733
|
+
...$(i)
|
|
2551
2734
|
}, e.name)), /* @__PURE__ */ d("button", {
|
|
2552
2735
|
type: "submit",
|
|
2553
2736
|
style: {
|
|
@@ -2560,16 +2743,16 @@ function At({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2560
2743
|
fontWeight: 600,
|
|
2561
2744
|
cursor: i ? "default" : "pointer"
|
|
2562
2745
|
},
|
|
2563
|
-
|
|
2746
|
+
...$(i),
|
|
2564
2747
|
children: t
|
|
2565
2748
|
})]
|
|
2566
2749
|
});
|
|
2567
2750
|
}
|
|
2568
|
-
function
|
|
2751
|
+
function Ht({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
2569
2752
|
return e.length ? /* @__PURE__ */ d("nav", {
|
|
2570
2753
|
ref: r,
|
|
2571
2754
|
"aria-label": "Breadcrumb",
|
|
2572
|
-
style: { ...
|
|
2755
|
+
style: { ...P(n) },
|
|
2573
2756
|
children: /* @__PURE__ */ d("ol", {
|
|
2574
2757
|
style: {
|
|
2575
2758
|
display: "flex",
|
|
@@ -2615,8 +2798,8 @@ function jt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2615
2798
|
})
|
|
2616
2799
|
}) : null;
|
|
2617
2800
|
}
|
|
2618
|
-
function
|
|
2619
|
-
let { tenant: g, apiUrl: _ } = i(
|
|
2801
|
+
function Ut({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", source: o, pageSize: s = 6, align: c, hideEmpty: u, inert: p, style: m, nodeRef: h }) {
|
|
2802
|
+
let { tenant: g, apiUrl: _ } = i(K), v = i(q), [y, b] = l(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
2620
2803
|
a(() => {
|
|
2621
2804
|
if (!o || Number.isFinite(x)) return;
|
|
2622
2805
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -2635,7 +2818,7 @@ function Mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
2635
2818
|
]);
|
|
2636
2819
|
let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
|
|
2637
2820
|
if (o && C === null || o && u && !(C > 0)) return null;
|
|
2638
|
-
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ?
|
|
2821
|
+
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? be(v) : Number(t) || 1, 1), w), E = (e) => {
|
|
2639
2822
|
if (o) {
|
|
2640
2823
|
if (typeof window < "u") {
|
|
2641
2824
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -2644,7 +2827,7 @@ function Mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
2644
2827
|
return `?page=${e}`;
|
|
2645
2828
|
}
|
|
2646
2829
|
return r && r !== "#" ? r.replace("{page}", String(e)) : "#";
|
|
2647
|
-
},
|
|
2830
|
+
}, D = c === "center" ? "center" : c === "right" ? "flex-end" : "flex-start", O = p ? (e) => e.preventDefault() : void 0, k = (e) => ({
|
|
2648
2831
|
display: "inline-flex",
|
|
2649
2832
|
alignItems: "center",
|
|
2650
2833
|
justifyContent: "center",
|
|
@@ -2666,33 +2849,33 @@ function Mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
2666
2849
|
flexWrap: "wrap",
|
|
2667
2850
|
gap: 8,
|
|
2668
2851
|
alignItems: "center",
|
|
2669
|
-
justifyContent:
|
|
2670
|
-
...
|
|
2852
|
+
justifyContent: D,
|
|
2853
|
+
...P(m)
|
|
2671
2854
|
},
|
|
2672
2855
|
children: [
|
|
2673
2856
|
n && /* @__PURE__ */ d("a", {
|
|
2674
2857
|
href: T > 1 ? E(T - 1) : "#",
|
|
2675
|
-
onClick:
|
|
2858
|
+
onClick: O,
|
|
2676
2859
|
"aria-label": "Previous",
|
|
2677
2860
|
style: {
|
|
2678
|
-
...
|
|
2861
|
+
...k(!1),
|
|
2679
2862
|
opacity: T > 1 ? 1 : .4
|
|
2680
2863
|
},
|
|
2681
2864
|
children: "‹"
|
|
2682
2865
|
}),
|
|
2683
2866
|
Array.from({ length: w }, (e, t) => t + 1).map((e) => /* @__PURE__ */ d("a", {
|
|
2684
2867
|
href: E(e),
|
|
2685
|
-
onClick:
|
|
2868
|
+
onClick: O,
|
|
2686
2869
|
"aria-current": e === T ? "page" : void 0,
|
|
2687
|
-
style:
|
|
2870
|
+
style: k(e === T),
|
|
2688
2871
|
children: e
|
|
2689
2872
|
}, e)),
|
|
2690
2873
|
n && /* @__PURE__ */ d("a", {
|
|
2691
2874
|
href: T < w ? E(T + 1) : "#",
|
|
2692
|
-
onClick:
|
|
2875
|
+
onClick: O,
|
|
2693
2876
|
"aria-label": "Next",
|
|
2694
2877
|
style: {
|
|
2695
|
-
...
|
|
2878
|
+
...k(!1),
|
|
2696
2879
|
opacity: T < w ? 1 : .4
|
|
2697
2880
|
},
|
|
2698
2881
|
children: "›"
|
|
@@ -2700,15 +2883,15 @@ function Mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
2700
2883
|
]
|
|
2701
2884
|
});
|
|
2702
2885
|
}
|
|
2703
|
-
var
|
|
2886
|
+
var Wt = "webim.page_mode", Gt = () => {
|
|
2704
2887
|
if (typeof window > "u") return "auto";
|
|
2705
2888
|
try {
|
|
2706
|
-
let e = window.localStorage.getItem(
|
|
2889
|
+
let e = window.localStorage.getItem(Wt);
|
|
2707
2890
|
return e === "light" || e === "dark" ? e : "auto";
|
|
2708
2891
|
} catch {
|
|
2709
2892
|
return "auto";
|
|
2710
2893
|
}
|
|
2711
|
-
},
|
|
2894
|
+
}, Kt = (e) => {
|
|
2712
2895
|
let t = {
|
|
2713
2896
|
width: 16,
|
|
2714
2897
|
height: 16,
|
|
@@ -2740,13 +2923,13 @@ var Nt = "webim.page_mode", Pt = () => {
|
|
|
2740
2923
|
rx: "2"
|
|
2741
2924
|
}), /* @__PURE__ */ d("path", { d: "M8 21h8M12 17v4" })]
|
|
2742
2925
|
});
|
|
2743
|
-
},
|
|
2926
|
+
}, qt = {
|
|
2744
2927
|
light: "Light theme",
|
|
2745
2928
|
dark: "Dark theme",
|
|
2746
2929
|
auto: "Follow the device theme"
|
|
2747
2930
|
};
|
|
2748
|
-
function
|
|
2749
|
-
let [o, s] = l(i ? "auto" :
|
|
2931
|
+
function Jt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
2932
|
+
let [o, s] = l(i ? "auto" : Gt), u = c(null), f = (e) => {
|
|
2750
2933
|
u.current = e, typeof r == "function" && r(e);
|
|
2751
2934
|
};
|
|
2752
2935
|
a(() => {
|
|
@@ -2754,7 +2937,7 @@ function It({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
2754
2937
|
let e = u.current?.closest?.(".webim-page");
|
|
2755
2938
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
2756
2939
|
try {
|
|
2757
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
2940
|
+
o === "auto" ? window.localStorage.removeItem(Wt) : window.localStorage.setItem(Wt, o);
|
|
2758
2941
|
} catch {}
|
|
2759
2942
|
}, [o, i]);
|
|
2760
2943
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -2785,12 +2968,12 @@ function It({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
2785
2968
|
padding: 3,
|
|
2786
2969
|
borderRadius: 999,
|
|
2787
2970
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
2788
|
-
...
|
|
2971
|
+
...P(n)
|
|
2789
2972
|
},
|
|
2790
2973
|
children: p.map((e) => /* @__PURE__ */ d("button", {
|
|
2791
2974
|
type: "button",
|
|
2792
|
-
title:
|
|
2793
|
-
"aria-label":
|
|
2975
|
+
title: qt[e],
|
|
2976
|
+
"aria-label": qt[e],
|
|
2794
2977
|
"aria-pressed": e === m,
|
|
2795
2978
|
onClick: i ? void 0 : () => s(e),
|
|
2796
2979
|
style: {
|
|
@@ -2801,27 +2984,27 @@ function It({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
2801
2984
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
2802
2985
|
opacity: e === m ? 1 : .7
|
|
2803
2986
|
},
|
|
2804
|
-
children:
|
|
2987
|
+
children: Kt(e)
|
|
2805
2988
|
}, e))
|
|
2806
2989
|
});
|
|
2807
2990
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
2808
2991
|
return /* @__PURE__ */ d("button", {
|
|
2809
2992
|
ref: f,
|
|
2810
2993
|
type: "button",
|
|
2811
|
-
title:
|
|
2812
|
-
"aria-label": `Theme: ${
|
|
2994
|
+
title: qt[m],
|
|
2995
|
+
"aria-label": `Theme: ${qt[m]} — switch to ${qt[g]}`,
|
|
2813
2996
|
onClick: i ? void 0 : () => s(g),
|
|
2814
2997
|
style: {
|
|
2815
2998
|
...h,
|
|
2816
2999
|
width: 36,
|
|
2817
3000
|
height: 36,
|
|
2818
3001
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
2819
|
-
...
|
|
3002
|
+
...P(n)
|
|
2820
3003
|
},
|
|
2821
|
-
children:
|
|
3004
|
+
children: Kt(m)
|
|
2822
3005
|
});
|
|
2823
3006
|
}
|
|
2824
|
-
function
|
|
3007
|
+
function Yt(e) {
|
|
2825
3008
|
let t = e?.parentElement;
|
|
2826
3009
|
for (; t && t !== document.body;) {
|
|
2827
3010
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -2830,7 +3013,7 @@ function Lt(e) {
|
|
|
2830
3013
|
}
|
|
2831
3014
|
return window;
|
|
2832
3015
|
}
|
|
2833
|
-
var
|
|
3016
|
+
var Xt = (e) => e === window ? window.scrollY : e.scrollTop, Zt = {
|
|
2834
3017
|
"bottom-right": (e) => ({
|
|
2835
3018
|
right: e,
|
|
2836
3019
|
bottom: e
|
|
@@ -2845,7 +3028,7 @@ var Rt = (e) => e === window ? window.scrollY : e.scrollTop, zt = {
|
|
|
2845
3028
|
transform: "translateX(-50%)"
|
|
2846
3029
|
})
|
|
2847
3030
|
};
|
|
2848
|
-
function
|
|
3031
|
+
function Qt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth: o, bg: s, fg: c, style: u, nodeRef: p, inert: m, frame: h, builder: g }) {
|
|
2849
3032
|
let [_, v] = l(!!m), [y, b] = l(null), x = (e) => {
|
|
2850
3033
|
b(e), typeof p == "function" && p(e);
|
|
2851
3034
|
};
|
|
@@ -2856,8 +3039,8 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
2856
3039
|
}
|
|
2857
3040
|
if (!y) return;
|
|
2858
3041
|
let e = Number(i) >= 0 ? Number(i) : 300, t = () => {
|
|
2859
|
-
let t =
|
|
2860
|
-
v(n ||
|
|
3042
|
+
let t = Yt(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
3043
|
+
v(n || Xt(t) > e);
|
|
2861
3044
|
};
|
|
2862
3045
|
return t(), document.addEventListener("scroll", t, {
|
|
2863
3046
|
capture: !0,
|
|
@@ -2871,7 +3054,7 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
2871
3054
|
]);
|
|
2872
3055
|
let S = () => {
|
|
2873
3056
|
if (m) return;
|
|
2874
|
-
let e =
|
|
3057
|
+
let e = Yt(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
2875
3058
|
e === window ? window.scrollTo({
|
|
2876
3059
|
top: 0,
|
|
2877
3060
|
behavior: n
|
|
@@ -2879,7 +3062,7 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
2879
3062
|
top: 0,
|
|
2880
3063
|
behavior: n
|
|
2881
3064
|
});
|
|
2882
|
-
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E =
|
|
3065
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = Zt[n] ? n : "bottom-right", D = h ? {
|
|
2883
3066
|
position: "fixed",
|
|
2884
3067
|
zIndex: 5,
|
|
2885
3068
|
bottom: (h.bottom ?? 0) + C,
|
|
@@ -2892,7 +3075,7 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
2892
3075
|
} : {
|
|
2893
3076
|
position: "fixed",
|
|
2894
3077
|
zIndex: 2147482e3,
|
|
2895
|
-
...
|
|
3078
|
+
...Zt[E](C)
|
|
2896
3079
|
};
|
|
2897
3080
|
return /* @__PURE__ */ f("button", {
|
|
2898
3081
|
ref: x,
|
|
@@ -2923,9 +3106,9 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
2923
3106
|
opacity: +!!_,
|
|
2924
3107
|
pointerEvents: _ ? "auto" : "none",
|
|
2925
3108
|
transition: "opacity 160ms ease, transform 160ms ease",
|
|
2926
|
-
...
|
|
2927
|
-
...
|
|
2928
|
-
...
|
|
3109
|
+
...D,
|
|
3110
|
+
...P(u),
|
|
3111
|
+
...D.transform ? { transform: D.transform } : null
|
|
2929
3112
|
},
|
|
2930
3113
|
children: [/* @__PURE__ */ d("svg", {
|
|
2931
3114
|
width: "18",
|
|
@@ -2943,7 +3126,7 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
2943
3126
|
}), w ? /* @__PURE__ */ d("span", { children: T }) : null]
|
|
2944
3127
|
});
|
|
2945
3128
|
}
|
|
2946
|
-
var
|
|
3129
|
+
var $t = {
|
|
2947
3130
|
facebook: {
|
|
2948
3131
|
label: "Facebook",
|
|
2949
3132
|
color: "#1877f2",
|
|
@@ -3010,8 +3193,8 @@ var Vt = {
|
|
|
3010
3193
|
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"
|
|
3011
3194
|
}
|
|
3012
3195
|
};
|
|
3013
|
-
function
|
|
3014
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
3196
|
+
function en({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
3197
|
+
let l = Array.isArray(e) ? e.filter((e) => e && $t[e.network]) : [];
|
|
3015
3198
|
if (!l.length) return null;
|
|
3016
3199
|
let u = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(u * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, h = c ? (e) => e.preventDefault() : void 0;
|
|
3017
3200
|
return /* @__PURE__ */ d("div", {
|
|
@@ -3021,10 +3204,10 @@ function Ht({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3021
3204
|
flexWrap: "wrap",
|
|
3022
3205
|
alignItems: "center",
|
|
3023
3206
|
gap: p,
|
|
3024
|
-
...
|
|
3207
|
+
...P(o)
|
|
3025
3208
|
},
|
|
3026
3209
|
children: l.map((e, r) => {
|
|
3027
|
-
let i =
|
|
3210
|
+
let i = $t[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
|
|
3028
3211
|
return /* @__PURE__ */ d("a", {
|
|
3029
3212
|
href: e.url || "#",
|
|
3030
3213
|
onClick: h,
|
|
@@ -3058,7 +3241,7 @@ function Ht({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3058
3241
|
})
|
|
3059
3242
|
});
|
|
3060
3243
|
}
|
|
3061
|
-
function
|
|
3244
|
+
function tn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
3062
3245
|
if (!e.length) return null;
|
|
3063
3246
|
let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
|
|
3064
3247
|
width: 32,
|
|
@@ -3096,7 +3279,7 @@ function Ut({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3096
3279
|
flexDirection: r ? "column" : "row",
|
|
3097
3280
|
alignItems: r ? "stretch" : "flex-start",
|
|
3098
3281
|
gap: r ? 4 : 8,
|
|
3099
|
-
...
|
|
3282
|
+
...P(i)
|
|
3100
3283
|
},
|
|
3101
3284
|
children: e.map((e, n) => {
|
|
3102
3285
|
let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
|
|
@@ -3136,7 +3319,7 @@ function Ut({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3136
3319
|
})
|
|
3137
3320
|
});
|
|
3138
3321
|
}
|
|
3139
|
-
var
|
|
3322
|
+
var nn = {
|
|
3140
3323
|
small: {
|
|
3141
3324
|
w: 132,
|
|
3142
3325
|
h: 46,
|
|
@@ -3158,10 +3341,10 @@ var Wt = {
|
|
|
3158
3341
|
title: 12.5,
|
|
3159
3342
|
avatar: 46
|
|
3160
3343
|
}
|
|
3161
|
-
},
|
|
3162
|
-
|
|
3163
|
-
function
|
|
3164
|
-
let r =
|
|
3344
|
+
}, rn = (e) => nn[e] ?? nn.medium;
|
|
3345
|
+
nn.medium.w, nn.medium.h;
|
|
3346
|
+
function an(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
3347
|
+
let r = rn(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 = [];
|
|
3165
3348
|
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);
|
|
3166
3349
|
let d = /* @__PURE__ */ new Map(), f = (e, t) => {
|
|
3167
3350
|
if (t.has(e.id)) return 0;
|
|
@@ -3213,19 +3396,19 @@ function Kt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
|
3213
3396
|
horizontal: n
|
|
3214
3397
|
};
|
|
3215
3398
|
}
|
|
3216
|
-
var
|
|
3399
|
+
var on = (e, t) => {
|
|
3217
3400
|
let n = String(e ?? "");
|
|
3218
3401
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
3219
|
-
},
|
|
3402
|
+
}, sn = (e) => {
|
|
3220
3403
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
3221
3404
|
if (!t) return "#ffffff";
|
|
3222
3405
|
let n = t[1];
|
|
3223
3406
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
3224
3407
|
let r = parseInt(n, 16);
|
|
3225
3408
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
3226
|
-
},
|
|
3227
|
-
function
|
|
3228
|
-
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 ? "" :
|
|
3409
|
+
}, cn = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
3410
|
+
function ln(e, t = {}) {
|
|
3411
|
+
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 ? "" : J(e);
|
|
3229
3412
|
return n.map((e) => {
|
|
3230
3413
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
3231
3414
|
return {
|
|
@@ -3239,11 +3422,11 @@ function Xt(e, t = {}) {
|
|
|
3239
3422
|
};
|
|
3240
3423
|
});
|
|
3241
3424
|
}
|
|
3242
|
-
var
|
|
3425
|
+
var un = {
|
|
3243
3426
|
size: 36,
|
|
3244
3427
|
pad: 10
|
|
3245
3428
|
};
|
|
3246
|
-
function
|
|
3429
|
+
function dn({ node: e, onClose: t }) {
|
|
3247
3430
|
return a(() => {
|
|
3248
3431
|
let e = (e) => e.key === "Escape" && t();
|
|
3249
3432
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -3364,15 +3547,15 @@ function Qt({ node: e, onClose: t }) {
|
|
|
3364
3547
|
})
|
|
3365
3548
|
});
|
|
3366
3549
|
}
|
|
3367
|
-
function
|
|
3368
|
-
let b = o(), [x, S] = l(null), { tenant: C, apiUrl: w } = i(
|
|
3550
|
+
function fn({ 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 }) {
|
|
3551
|
+
let b = o(), [x, S] = l(null), { tenant: C, apiUrl: w } = i(K), T = i(q)?.[t], [E, D] = l(null);
|
|
3369
3552
|
a(() => {
|
|
3370
3553
|
if (!t || T) return;
|
|
3371
3554
|
let e = !0;
|
|
3372
3555
|
return fetch(`${w}/dynamic/${encodeURIComponent(t)}`, { headers: C ? { "x-tenant": C } : {} }).then((e) => e.json()).then((t) => {
|
|
3373
3556
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
3374
|
-
e &&
|
|
3375
|
-
}).catch(() => e &&
|
|
3557
|
+
e && D(n);
|
|
3558
|
+
}).catch(() => e && D([])), () => {
|
|
3376
3559
|
e = !1;
|
|
3377
3560
|
};
|
|
3378
3561
|
}, [
|
|
@@ -3381,18 +3564,18 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3381
3564
|
w,
|
|
3382
3565
|
T
|
|
3383
3566
|
]);
|
|
3384
|
-
let
|
|
3567
|
+
let O = t ? ln(T ?? E ?? [], {
|
|
3385
3568
|
nameField: n,
|
|
3386
3569
|
titleField: r,
|
|
3387
3570
|
photoField: s,
|
|
3388
3571
|
parentField: c,
|
|
3389
3572
|
cvField: p,
|
|
3390
3573
|
hrefField: m
|
|
3391
|
-
}) : e,
|
|
3574
|
+
}) : e, k = rn(h), { boxes: A, links: j, width: M, height: N } = an(O, {
|
|
3392
3575
|
size: h,
|
|
3393
3576
|
horizontal: g
|
|
3394
3577
|
});
|
|
3395
|
-
if (!
|
|
3578
|
+
if (!A.length) return !y && t ? /* @__PURE__ */ f("div", {
|
|
3396
3579
|
ref: v,
|
|
3397
3580
|
style: {
|
|
3398
3581
|
padding: 18,
|
|
@@ -3401,7 +3584,7 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3401
3584
|
fontSize: 13,
|
|
3402
3585
|
opacity: .7,
|
|
3403
3586
|
textAlign: "center",
|
|
3404
|
-
...
|
|
3587
|
+
...P(_)
|
|
3405
3588
|
},
|
|
3406
3589
|
children: [
|
|
3407
3590
|
"Org Chart — no published entries in “",
|
|
@@ -3409,32 +3592,32 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3409
3592
|
"” yet"
|
|
3410
3593
|
]
|
|
3411
3594
|
}) : null;
|
|
3412
|
-
let F = new Set(
|
|
3595
|
+
let F = new Set(A.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
|
|
3413
3596
|
return /* @__PURE__ */ f("div", {
|
|
3414
3597
|
ref: v,
|
|
3415
3598
|
style: {
|
|
3416
3599
|
maxWidth: "100%",
|
|
3417
3600
|
overflowX: "auto",
|
|
3418
|
-
...
|
|
3601
|
+
...P(_)
|
|
3419
3602
|
},
|
|
3420
3603
|
children: [/* @__PURE__ */ f("svg", {
|
|
3421
|
-
viewBox: `0 0 ${
|
|
3604
|
+
viewBox: `0 0 ${M} ${N}`,
|
|
3422
3605
|
role: "img",
|
|
3423
3606
|
"aria-label": "Organization chart",
|
|
3424
3607
|
style: {
|
|
3425
3608
|
display: "block",
|
|
3426
3609
|
width: "100%",
|
|
3427
|
-
maxWidth:
|
|
3610
|
+
maxWidth: M,
|
|
3428
3611
|
height: "auto",
|
|
3429
3612
|
margin: "0 auto"
|
|
3430
3613
|
},
|
|
3431
|
-
children: [
|
|
3614
|
+
children: [j.map((e, t) => /* @__PURE__ */ d("path", {
|
|
3432
3615
|
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}`,
|
|
3433
3616
|
fill: "none",
|
|
3434
3617
|
stroke: "rgba(148, 163, 184, 0.7)",
|
|
3435
3618
|
strokeWidth: "1.5"
|
|
3436
|
-
}, t)),
|
|
3437
|
-
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 ?
|
|
3619
|
+
}, t)), A.map(({ node: e, x: t, y: n }) => {
|
|
3620
|
+
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? sn(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? sn(e.color2) : s, l = y && (cn(e) || e.href), p = () => cn(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + un.pad + k.avatar + 8 : t + k.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((k.w - k.avatar - 26) / 7) : Math.floor(k.w / 7.6), _ = k.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
3438
3621
|
return /* @__PURE__ */ f("g", {
|
|
3439
3622
|
onClick: l ? p : void 0,
|
|
3440
3623
|
style: l ? { cursor: "pointer" } : void 0,
|
|
@@ -3457,8 +3640,8 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3457
3640
|
}), /* @__PURE__ */ d("rect", {
|
|
3458
3641
|
x: t,
|
|
3459
3642
|
y: n,
|
|
3460
|
-
width:
|
|
3461
|
-
height:
|
|
3643
|
+
width: k.w,
|
|
3644
|
+
height: k.h,
|
|
3462
3645
|
rx: "10",
|
|
3463
3646
|
fill: `url(#${b}-${e.id}-grad)`
|
|
3464
3647
|
})] }) : i ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
@@ -3466,8 +3649,8 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3466
3649
|
children: /* @__PURE__ */ d("rect", {
|
|
3467
3650
|
x: t,
|
|
3468
3651
|
y: n,
|
|
3469
|
-
width:
|
|
3470
|
-
height:
|
|
3652
|
+
width: k.w,
|
|
3653
|
+
height: k.h,
|
|
3471
3654
|
rx: "10"
|
|
3472
3655
|
})
|
|
3473
3656
|
}), /* @__PURE__ */ f("g", {
|
|
@@ -3475,21 +3658,21 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3475
3658
|
children: [/* @__PURE__ */ d("rect", {
|
|
3476
3659
|
x: t,
|
|
3477
3660
|
y: n,
|
|
3478
|
-
width:
|
|
3661
|
+
width: k.w,
|
|
3479
3662
|
height: _,
|
|
3480
3663
|
fill: o
|
|
3481
3664
|
}), /* @__PURE__ */ d("rect", {
|
|
3482
3665
|
x: t,
|
|
3483
3666
|
y: n + _,
|
|
3484
|
-
width:
|
|
3485
|
-
height:
|
|
3667
|
+
width: k.w,
|
|
3668
|
+
height: k.h - _,
|
|
3486
3669
|
fill: e.color2
|
|
3487
3670
|
})]
|
|
3488
3671
|
})] }) : /* @__PURE__ */ d("rect", {
|
|
3489
3672
|
x: t,
|
|
3490
3673
|
y: n,
|
|
3491
|
-
width:
|
|
3492
|
-
height:
|
|
3674
|
+
width: k.w,
|
|
3675
|
+
height: k.h,
|
|
3493
3676
|
rx: "10",
|
|
3494
3677
|
fill: o,
|
|
3495
3678
|
stroke: a ? "none" : "var(--page-accent, #4f46e5)",
|
|
@@ -3498,63 +3681,63 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3498
3681
|
e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
3499
3682
|
id: `${b}-${e.id}`,
|
|
3500
3683
|
children: /* @__PURE__ */ d("circle", {
|
|
3501
|
-
cx: t +
|
|
3502
|
-
cy: n +
|
|
3503
|
-
r:
|
|
3684
|
+
cx: t + un.pad + k.avatar / 2,
|
|
3685
|
+
cy: n + k.h / 2,
|
|
3686
|
+
r: k.avatar / 2
|
|
3504
3687
|
})
|
|
3505
3688
|
}), /* @__PURE__ */ d("image", {
|
|
3506
3689
|
href: e.photo,
|
|
3507
|
-
x: t +
|
|
3508
|
-
y: n + (
|
|
3509
|
-
width:
|
|
3510
|
-
height:
|
|
3690
|
+
x: t + un.pad,
|
|
3691
|
+
y: n + (k.h - k.avatar) / 2,
|
|
3692
|
+
width: k.avatar,
|
|
3693
|
+
height: k.avatar,
|
|
3511
3694
|
preserveAspectRatio: "xMidYMid slice",
|
|
3512
3695
|
clipPath: `url(#${b}-${e.id})`
|
|
3513
3696
|
})] }),
|
|
3514
3697
|
i && !e.gradient ? /* @__PURE__ */ f(u, { children: [e.title && /* @__PURE__ */ d("text", {
|
|
3515
3698
|
x: m,
|
|
3516
|
-
y: n + _ / 2 +
|
|
3699
|
+
y: n + _ / 2 + k.title * .35,
|
|
3517
3700
|
textAnchor: h,
|
|
3518
|
-
fontSize:
|
|
3701
|
+
fontSize: k.title,
|
|
3519
3702
|
fontWeight: "600",
|
|
3520
3703
|
fill: s,
|
|
3521
|
-
children:
|
|
3704
|
+
children: on(e.title, g + 4)
|
|
3522
3705
|
}), e.name && /* @__PURE__ */ d("text", {
|
|
3523
3706
|
x: m,
|
|
3524
|
-
y: n + _ + _ / 2 +
|
|
3707
|
+
y: n + _ + _ / 2 + k.name * .35,
|
|
3525
3708
|
textAnchor: h,
|
|
3526
|
-
fontSize:
|
|
3709
|
+
fontSize: k.name,
|
|
3527
3710
|
fontWeight: "600",
|
|
3528
3711
|
fill: c,
|
|
3529
|
-
children:
|
|
3712
|
+
children: on(e.name, g)
|
|
3530
3713
|
})] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
|
|
3531
3714
|
x: m,
|
|
3532
|
-
y: n + (v[1] ?
|
|
3715
|
+
y: n + (v[1] ? k.h * .43 : k.h * .57),
|
|
3533
3716
|
textAnchor: h,
|
|
3534
|
-
fontSize:
|
|
3717
|
+
fontSize: k.name,
|
|
3535
3718
|
fontWeight: "600",
|
|
3536
3719
|
fill: s,
|
|
3537
|
-
children:
|
|
3720
|
+
children: on(v[0], g)
|
|
3538
3721
|
}), v[1] && /* @__PURE__ */ d("text", {
|
|
3539
3722
|
x: m,
|
|
3540
|
-
y: n +
|
|
3723
|
+
y: n + k.h * .73,
|
|
3541
3724
|
textAnchor: h,
|
|
3542
|
-
fontSize:
|
|
3725
|
+
fontSize: k.title,
|
|
3543
3726
|
opacity: "0.7",
|
|
3544
3727
|
fill: s,
|
|
3545
|
-
children:
|
|
3728
|
+
children: on(v[1], g + 4)
|
|
3546
3729
|
})] })
|
|
3547
3730
|
]
|
|
3548
3731
|
}, e.id);
|
|
3549
3732
|
})]
|
|
3550
|
-
}), x && /* @__PURE__ */ d(
|
|
3733
|
+
}), x && /* @__PURE__ */ d(dn, {
|
|
3551
3734
|
node: x,
|
|
3552
3735
|
onClose: () => S(null)
|
|
3553
3736
|
})]
|
|
3554
3737
|
});
|
|
3555
3738
|
}
|
|
3556
|
-
function
|
|
3557
|
-
let { tenant: g, apiUrl: _ } = i(
|
|
3739
|
+
function pn({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped: o = !0, bordered: s = !1, compact: c = !1, paged: u, emptyText: p, style: m, nodeRef: h }) {
|
|
3740
|
+
let { tenant: g, apiUrl: _ } = i(K), v = i(q), y = v?.[n], b = u ? be(v) : 1, [x, S] = l(null);
|
|
3558
3741
|
if (a(() => {
|
|
3559
3742
|
if (!n || y) return;
|
|
3560
3743
|
let e = !0, t = Math.max(1, Number(r) || 10), i = u && !n.startsWith("api:") ? `?offset=${(b - 1) * t}&limit=${t}` : "", a = n.startsWith("api:") ? `${_}/data/${encodeURIComponent(n.slice(4))}` : `${_}/dynamic/${encodeURIComponent(n)}${i}`;
|
|
@@ -3573,45 +3756,45 @@ function en({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
|
|
|
3573
3756
|
b,
|
|
3574
3757
|
r
|
|
3575
3758
|
]), !e.length) return null;
|
|
3576
|
-
let C = Math.max(1, Number(r) || 10), w = n ? u ? y || n.startsWith("api:") ? (y ?? x ?? []).slice((b - 1) * C, b * C) : (x ?? []).slice(0, C) : (y ?? x ?? []).slice(0, C) : null, T = w ? w.map((t) => e.map((e) =>
|
|
3759
|
+
let C = Math.max(1, Number(r) || 10), w = n ? u ? y || n.startsWith("api:") ? (y ?? x ?? []).slice((b - 1) * C, b * C) : (x ?? []).slice(0, C) : (y ?? x ?? []).slice(0, C) : null, T = w ? w.map((t) => e.map((e) => J(Te(t?.data, e.field)))) : t, E = !!n && !(n && !y && x === null) && T.length === 0, D = c ? "6px 10px" : "10px 14px", O = "1px solid rgba(148, 163, 184, 0.35)", k = s ? { border: O } : { borderBottom: O };
|
|
3577
3760
|
return /* @__PURE__ */ d("div", {
|
|
3578
3761
|
ref: h,
|
|
3579
3762
|
style: {
|
|
3580
3763
|
width: "100%",
|
|
3581
3764
|
overflowX: "auto",
|
|
3582
|
-
...
|
|
3765
|
+
...P(m)
|
|
3583
3766
|
},
|
|
3584
3767
|
children: /* @__PURE__ */ f("table", {
|
|
3585
3768
|
style: {
|
|
3586
3769
|
width: "100%",
|
|
3587
3770
|
borderCollapse: "collapse",
|
|
3588
3771
|
fontSize: 14,
|
|
3589
|
-
...s ? { border:
|
|
3772
|
+
...s ? { border: O } : {}
|
|
3590
3773
|
},
|
|
3591
3774
|
children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e.map((e, t) => /* @__PURE__ */ d("th", {
|
|
3592
3775
|
style: {
|
|
3593
3776
|
textAlign: "left",
|
|
3594
3777
|
fontWeight: 600,
|
|
3595
|
-
padding:
|
|
3778
|
+
padding: D,
|
|
3596
3779
|
background: "rgba(148, 163, 184, 0.12)",
|
|
3597
|
-
...
|
|
3780
|
+
...k
|
|
3598
3781
|
},
|
|
3599
3782
|
children: e.label ?? e
|
|
3600
3783
|
}, t)) }) }), /* @__PURE__ */ f("tbody", { children: [E && /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
|
|
3601
3784
|
colSpan: e.length,
|
|
3602
3785
|
style: {
|
|
3603
|
-
padding:
|
|
3786
|
+
padding: D,
|
|
3604
3787
|
textAlign: "center",
|
|
3605
3788
|
opacity: .6,
|
|
3606
|
-
...
|
|
3789
|
+
...k
|
|
3607
3790
|
},
|
|
3608
3791
|
children: p || "No data yet"
|
|
3609
3792
|
}) }), T.map((t, n) => /* @__PURE__ */ d("tr", {
|
|
3610
3793
|
style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
|
|
3611
3794
|
children: e.map((e, n) => /* @__PURE__ */ d("td", {
|
|
3612
3795
|
style: {
|
|
3613
|
-
padding:
|
|
3614
|
-
...
|
|
3796
|
+
padding: D,
|
|
3797
|
+
...k
|
|
3615
3798
|
},
|
|
3616
3799
|
children: t?.[n] ?? ""
|
|
3617
3800
|
}, n))
|
|
@@ -3619,124 +3802,642 @@ function en({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
|
|
|
3619
3802
|
})
|
|
3620
3803
|
});
|
|
3621
3804
|
}
|
|
3622
|
-
var
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3805
|
+
var mn = {
|
|
3806
|
+
small: {
|
|
3807
|
+
cell: 62,
|
|
3808
|
+
font: 10.5,
|
|
3809
|
+
head: 11,
|
|
3810
|
+
title: 15,
|
|
3811
|
+
pad: 4,
|
|
3812
|
+
gap: 2
|
|
3813
|
+
},
|
|
3814
|
+
medium: {
|
|
3815
|
+
cell: 92,
|
|
3816
|
+
font: 12,
|
|
3817
|
+
head: 12,
|
|
3818
|
+
title: 18,
|
|
3819
|
+
pad: 6,
|
|
3820
|
+
gap: 3
|
|
3821
|
+
},
|
|
3822
|
+
large: {
|
|
3823
|
+
cell: 124,
|
|
3824
|
+
font: 13,
|
|
3825
|
+
head: 13,
|
|
3826
|
+
title: 22,
|
|
3827
|
+
pad: 8,
|
|
3828
|
+
gap: 4
|
|
3829
|
+
}
|
|
3830
|
+
}, hn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, gn = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), _n = 366;
|
|
3831
|
+
function vn(e, t = {}) {
|
|
3832
|
+
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 ? "" : J(e), a = (e) => {
|
|
3833
|
+
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
3834
|
+
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
3835
|
+
};
|
|
3836
|
+
return n.map((e) => {
|
|
3837
|
+
let n = e.data ?? {}, o = a(n[t.startField]);
|
|
3838
|
+
return o ? {
|
|
3839
|
+
key: e.id,
|
|
3840
|
+
title: i(n[t.titleField || "name"]) || i(n.name) || "Untitled",
|
|
3841
|
+
start: o,
|
|
3842
|
+
end: a(n[t.endField]),
|
|
3843
|
+
href: t.hrefField ? i(n[t.hrefField]) : "",
|
|
3844
|
+
color: t.colorField ? i(r(n[t.colorField])) : ""
|
|
3845
|
+
} : null;
|
|
3846
|
+
}).filter(Boolean);
|
|
3847
|
+
}
|
|
3848
|
+
function yn(e) {
|
|
3849
|
+
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
3850
|
+
let n = e?.start ? new Date(e.start) : null;
|
|
3851
|
+
if (!n || Number.isNaN(n.getTime())) return null;
|
|
3852
|
+
let r = e?.end ? new Date(e.end) : null;
|
|
3853
|
+
return {
|
|
3854
|
+
key: e.key ?? `event-${t}`,
|
|
3855
|
+
title: e.title ?? "",
|
|
3856
|
+
start: n,
|
|
3857
|
+
end: r && !Number.isNaN(r.getTime()) ? r : null,
|
|
3858
|
+
href: e.href ?? "",
|
|
3859
|
+
color: e.color ?? ""
|
|
3860
|
+
};
|
|
3861
|
+
}).filter(Boolean);
|
|
3862
|
+
}
|
|
3863
|
+
function bn(e) {
|
|
3864
|
+
let t = /* @__PURE__ */ new Map();
|
|
3865
|
+
for (let n of e) {
|
|
3866
|
+
let e = gn(n.start), r = n.end ? gn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), _n);
|
|
3867
|
+
for (let r = 0; r <= i; r += 1) {
|
|
3868
|
+
let i = hn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
3869
|
+
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
3870
|
+
}
|
|
3871
|
+
}
|
|
3872
|
+
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
3873
|
+
return t;
|
|
3874
|
+
}
|
|
3875
|
+
function xn({ events: e = [], source: t = "", titleField: n = "", startField: r = "", endField: o = "", hrefField: s = "", colorField: c = "", variant: p = "month", size: m = "medium", accent: h = "", eventBg: g = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
|
|
3876
|
+
let { tenant: T, apiUrl: E, locale: D } = i(K), O = i(q)?.[t], [k, A] = l(null), [j, M] = l(() => {
|
|
3877
|
+
let e = /* @__PURE__ */ new Date();
|
|
3878
|
+
return {
|
|
3879
|
+
year: e.getFullYear(),
|
|
3880
|
+
month: e.getMonth()
|
|
3881
|
+
};
|
|
3882
|
+
});
|
|
3883
|
+
a(() => {
|
|
3884
|
+
if (!t || O) return;
|
|
3885
|
+
let e = !0;
|
|
3886
|
+
return fetch(`${E}/dynamic/${encodeURIComponent(t)}`, { headers: T ? { "x-tenant": T } : {} }).then((e) => e.json()).then((t) => {
|
|
3887
|
+
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
3888
|
+
e && A(n);
|
|
3889
|
+
}).catch(() => e && A([])), () => {
|
|
3890
|
+
e = !1;
|
|
3891
|
+
};
|
|
3892
|
+
}, [
|
|
3893
|
+
t,
|
|
3894
|
+
T,
|
|
3895
|
+
E,
|
|
3896
|
+
O
|
|
3897
|
+
]);
|
|
3898
|
+
let N = mn[m] ?? mn.medium, F = h || "var(--page-accent, #4f46e5)", I = v || "var(--page-border, rgba(148, 163, 184, 0.35))", L = g || F, R = _ || "var(--page-accent-text, #ffffff)", z = t ? vn(O ?? k ?? [], {
|
|
3899
|
+
titleField: n,
|
|
3900
|
+
startField: r,
|
|
3901
|
+
endField: o,
|
|
3902
|
+
hrefField: s,
|
|
3903
|
+
colorField: c
|
|
3904
|
+
}) : yn(e), B = bn(z), V = D || void 0, H = (e, t) => {
|
|
3905
|
+
let n = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", { style: {
|
|
3906
|
+
width: 6,
|
|
3907
|
+
height: 6,
|
|
3908
|
+
borderRadius: "50%",
|
|
3909
|
+
background: e.color || R,
|
|
3910
|
+
flexShrink: 0,
|
|
3911
|
+
opacity: e.color ? 1 : .85
|
|
3912
|
+
} }), /* @__PURE__ */ d("span", {
|
|
3913
|
+
style: {
|
|
3914
|
+
overflow: "hidden",
|
|
3915
|
+
textOverflow: "ellipsis",
|
|
3916
|
+
whiteSpace: "nowrap"
|
|
3917
|
+
},
|
|
3918
|
+
children: e.title
|
|
3919
|
+
})] }), r = {
|
|
3920
|
+
display: "flex",
|
|
3921
|
+
alignItems: "center",
|
|
3922
|
+
gap: 5,
|
|
3923
|
+
background: e.color ? `color-mix(in srgb, ${e.color} 18%, transparent)` : L,
|
|
3924
|
+
color: e.color ? "inherit" : R,
|
|
3925
|
+
borderRadius: 4,
|
|
3926
|
+
padding: "2px 5px",
|
|
3927
|
+
fontSize: N.font,
|
|
3928
|
+
lineHeight: 1.35,
|
|
3929
|
+
textDecoration: "none",
|
|
3930
|
+
...t
|
|
3931
|
+
};
|
|
3932
|
+
return e.href && w ? /* @__PURE__ */ d("a", {
|
|
3933
|
+
href: e.href,
|
|
3934
|
+
style: r,
|
|
3935
|
+
title: e.title,
|
|
3936
|
+
children: n
|
|
3937
|
+
}, e.key) : /* @__PURE__ */ d("div", {
|
|
3938
|
+
style: r,
|
|
3939
|
+
title: e.title,
|
|
3940
|
+
children: n
|
|
3941
|
+
}, e.key);
|
|
3942
|
+
}, U = new Intl.DateTimeFormat(V, {
|
|
3943
|
+
month: "long",
|
|
3944
|
+
year: "numeric"
|
|
3945
|
+
}).format(new Date(j.year, j.month, 1)), ee = (e) => M((t) => {
|
|
3946
|
+
let n = new Date(t.year, t.month + e, 1);
|
|
3947
|
+
return {
|
|
3948
|
+
year: n.getFullYear(),
|
|
3949
|
+
month: n.getMonth()
|
|
3950
|
+
};
|
|
3951
|
+
}), te = (e, t) => /* @__PURE__ */ d("button", {
|
|
3952
|
+
type: "button",
|
|
3953
|
+
"aria-label": e,
|
|
3954
|
+
onClick: () => ee(t),
|
|
3955
|
+
style: {
|
|
3956
|
+
background: "transparent",
|
|
3957
|
+
border: `1px solid ${I}`,
|
|
3958
|
+
borderRadius: 6,
|
|
3959
|
+
color: "inherit",
|
|
3960
|
+
cursor: "pointer",
|
|
3961
|
+
fontSize: N.head,
|
|
3962
|
+
lineHeight: 1,
|
|
3963
|
+
padding: "4px 8px"
|
|
3964
|
+
},
|
|
3965
|
+
children: t < 0 ? "‹" : "›"
|
|
3966
|
+
}), W = /* @__PURE__ */ f("div", {
|
|
3967
|
+
style: {
|
|
3968
|
+
display: "flex",
|
|
3969
|
+
alignItems: "center",
|
|
3970
|
+
gap: 8,
|
|
3971
|
+
marginBottom: N.pad + 2
|
|
3972
|
+
},
|
|
3973
|
+
children: [
|
|
3974
|
+
/* @__PURE__ */ d("div", {
|
|
3975
|
+
style: {
|
|
3976
|
+
fontSize: N.title,
|
|
3977
|
+
fontWeight: 700,
|
|
3978
|
+
flexGrow: 1,
|
|
3979
|
+
fontFamily: "var(--page-heading-font, inherit)"
|
|
3980
|
+
},
|
|
3981
|
+
children: U
|
|
3982
|
+
}),
|
|
3983
|
+
te("Previous month", -1),
|
|
3984
|
+
te("Next month", 1)
|
|
3985
|
+
]
|
|
3986
|
+
});
|
|
3987
|
+
if (p === "list") {
|
|
3988
|
+
let e = z.filter((e) => e.start.getFullYear() === j.year && e.start.getMonth() === j.month).sort((e, t) => e.start - t.start), t = new Intl.DateTimeFormat(V, {
|
|
3989
|
+
day: "numeric",
|
|
3990
|
+
month: "short",
|
|
3991
|
+
hour: "2-digit",
|
|
3992
|
+
minute: "2-digit"
|
|
3993
|
+
});
|
|
3994
|
+
return /* @__PURE__ */ f("div", {
|
|
3995
|
+
ref: C,
|
|
3996
|
+
style: {
|
|
3997
|
+
width: "100%",
|
|
3998
|
+
...P(S)
|
|
3999
|
+
},
|
|
4000
|
+
children: [W, e.length ? /* @__PURE__ */ d("div", {
|
|
4001
|
+
style: {
|
|
4002
|
+
display: "flex",
|
|
4003
|
+
flexDirection: "column",
|
|
4004
|
+
gap: N.gap + 2
|
|
4005
|
+
},
|
|
4006
|
+
children: e.map((e) => /* @__PURE__ */ f("div", {
|
|
4007
|
+
style: {
|
|
4008
|
+
display: "flex",
|
|
4009
|
+
alignItems: "center",
|
|
4010
|
+
gap: 10,
|
|
4011
|
+
borderBottom: `1px solid ${I}`,
|
|
4012
|
+
paddingBottom: N.gap + 2
|
|
4013
|
+
},
|
|
4014
|
+
children: [/* @__PURE__ */ d("span", {
|
|
4015
|
+
style: {
|
|
4016
|
+
fontSize: N.font,
|
|
4017
|
+
opacity: .7,
|
|
4018
|
+
minWidth: 96
|
|
4019
|
+
},
|
|
4020
|
+
children: t.format(e.start)
|
|
4021
|
+
}), H(e, {
|
|
4022
|
+
flexGrow: 1,
|
|
4023
|
+
minWidth: 0
|
|
4024
|
+
})]
|
|
4025
|
+
}, e.key))
|
|
4026
|
+
}) : /* @__PURE__ */ d("div", {
|
|
4027
|
+
style: {
|
|
4028
|
+
fontSize: N.font,
|
|
4029
|
+
opacity: .6,
|
|
4030
|
+
padding: N.pad * 2
|
|
4031
|
+
},
|
|
4032
|
+
children: x
|
|
4033
|
+
})]
|
|
4034
|
+
});
|
|
4035
|
+
}
|
|
4036
|
+
let ne = new Date(j.year, j.month, 1), re = y === "sunday" ? 0 : 1, ie = (ne.getDay() - re + 7) % 7, ae = new Date(j.year, j.month + 1, 0).getDate(), oe = Math.ceil((ie + ae) / 7), se = hn(/* @__PURE__ */ new Date()), ce = new Intl.DateTimeFormat(V, { weekday: "short" }), G = [];
|
|
4037
|
+
for (let e = 0; e < oe * 7; e += 1) {
|
|
4038
|
+
let t = e - ie + 1, n = t >= 1 && t <= ae, r = hn(new Date(j.year, j.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === se;
|
|
4039
|
+
G.push(/* @__PURE__ */ f("div", {
|
|
4040
|
+
style: {
|
|
4041
|
+
minHeight: N.cell,
|
|
4042
|
+
borderTop: `1px solid ${I}`,
|
|
4043
|
+
borderLeft: `1px solid ${I}`,
|
|
4044
|
+
padding: N.pad,
|
|
4045
|
+
display: "flex",
|
|
4046
|
+
flexDirection: "column",
|
|
4047
|
+
gap: N.gap,
|
|
4048
|
+
opacity: n ? 1 : .35,
|
|
4049
|
+
minWidth: 0
|
|
4050
|
+
},
|
|
4051
|
+
children: [
|
|
4052
|
+
/* @__PURE__ */ d("span", {
|
|
4053
|
+
style: {
|
|
4054
|
+
fontSize: N.font,
|
|
4055
|
+
fontWeight: o ? 700 : 400,
|
|
4056
|
+
alignSelf: "flex-start",
|
|
4057
|
+
borderRadius: "999px",
|
|
4058
|
+
padding: o ? "1px 6px" : 0,
|
|
4059
|
+
background: o ? F : "transparent",
|
|
4060
|
+
color: o ? R : "inherit"
|
|
4061
|
+
},
|
|
4062
|
+
children: n ? t : new Date(j.year, j.month, t).getDate()
|
|
4063
|
+
}),
|
|
4064
|
+
a.map((e) => H(e)),
|
|
4065
|
+
i.length > a.length && /* @__PURE__ */ d("span", {
|
|
4066
|
+
style: {
|
|
4067
|
+
fontSize: N.font,
|
|
4068
|
+
opacity: .6
|
|
4069
|
+
},
|
|
4070
|
+
children: `+${i.length - a.length}`
|
|
4071
|
+
})
|
|
4072
|
+
]
|
|
4073
|
+
}, e));
|
|
4074
|
+
}
|
|
4075
|
+
return /* @__PURE__ */ f("div", {
|
|
4076
|
+
ref: C,
|
|
4077
|
+
style: {
|
|
4078
|
+
width: "100%",
|
|
4079
|
+
...P(S)
|
|
4080
|
+
},
|
|
4081
|
+
children: [
|
|
4082
|
+
W,
|
|
4083
|
+
/* @__PURE__ */ f("div", {
|
|
4084
|
+
style: {
|
|
4085
|
+
display: "grid",
|
|
4086
|
+
gridTemplateColumns: "repeat(7, minmax(0, 1fr))"
|
|
4087
|
+
},
|
|
4088
|
+
children: [Array.from({ length: 7 }, (e, t) => /* @__PURE__ */ d("div", {
|
|
4089
|
+
style: {
|
|
4090
|
+
fontSize: N.head,
|
|
4091
|
+
fontWeight: 600,
|
|
4092
|
+
opacity: .7,
|
|
4093
|
+
textAlign: "center",
|
|
4094
|
+
padding: `0 0 ${N.pad}px`
|
|
4095
|
+
},
|
|
4096
|
+
children: ce.format(new Date(2024, 0, 7 + re + t))
|
|
4097
|
+
}, `head-${t}`)), G]
|
|
4098
|
+
}),
|
|
4099
|
+
/* @__PURE__ */ d("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4100
|
+
]
|
|
4101
|
+
});
|
|
4102
|
+
}
|
|
4103
|
+
var Sn = {
|
|
4104
|
+
small: 380,
|
|
4105
|
+
medium: 560,
|
|
4106
|
+
large: 820,
|
|
4107
|
+
full: "100%"
|
|
4108
|
+
};
|
|
4109
|
+
function Cn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: i = 0, size: o = "medium", title: s = "", showClose: u = !0, backdropClose: p = !0, position: m = "center", actions: h = [], showCloseAction: g = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
|
|
4110
|
+
let [C, w] = l(!1), T = c(null);
|
|
4111
|
+
a(() => {
|
|
4112
|
+
if (S || !e) return;
|
|
4113
|
+
let t = (t) => {
|
|
4114
|
+
t.target.closest?.(`a[href="#${e}"], [data-webim-open="${e}"]`) && (t.preventDefault(), w(!0));
|
|
4115
|
+
};
|
|
4116
|
+
return document.addEventListener("click", t), () => document.removeEventListener("click", t);
|
|
4117
|
+
}, [S, e]), a(() => {
|
|
4118
|
+
if (S || r !== "load") return;
|
|
4119
|
+
let e = setTimeout(() => w(!0), Math.max(0, Number(i) || 0) * 1e3);
|
|
4120
|
+
return () => clearTimeout(e);
|
|
4121
|
+
}, [
|
|
4122
|
+
S,
|
|
4123
|
+
r,
|
|
4124
|
+
i
|
|
4125
|
+
]), a(() => {
|
|
4126
|
+
if (S || !C) return;
|
|
4127
|
+
let e = (e) => e.key === "Escape" && w(!1);
|
|
4128
|
+
document.addEventListener("keydown", e);
|
|
4129
|
+
let t = document.body.style.overflow;
|
|
4130
|
+
return document.body.style.overflow = "hidden", T.current?.focus?.(), () => {
|
|
4131
|
+
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
4132
|
+
};
|
|
4133
|
+
}, [S, C]);
|
|
4134
|
+
let E = Sn[o] ?? Sn.medium, D = (e) => {
|
|
4135
|
+
let t = {
|
|
4136
|
+
padding: "9px 16px",
|
|
4137
|
+
borderRadius: 6,
|
|
4138
|
+
cursor: "pointer",
|
|
4139
|
+
fontSize: 14,
|
|
4140
|
+
fontFamily: "inherit",
|
|
4141
|
+
textDecoration: "none",
|
|
4142
|
+
display: "inline-block",
|
|
4143
|
+
...{
|
|
4144
|
+
primary: {
|
|
4145
|
+
background: "var(--page-accent, #4f46e5)",
|
|
4146
|
+
color: "var(--page-accent-text, #ffffff)",
|
|
4147
|
+
border: "1px solid transparent"
|
|
4148
|
+
},
|
|
4149
|
+
outline: {
|
|
4150
|
+
background: "transparent",
|
|
4151
|
+
color: "inherit",
|
|
4152
|
+
border: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))"
|
|
4153
|
+
},
|
|
4154
|
+
text: {
|
|
4155
|
+
background: "transparent",
|
|
4156
|
+
color: "inherit",
|
|
4157
|
+
border: "1px solid transparent"
|
|
4158
|
+
},
|
|
4159
|
+
danger: {
|
|
4160
|
+
background: "#dc2626",
|
|
4161
|
+
color: "#ffffff",
|
|
4162
|
+
border: "1px solid transparent"
|
|
4163
|
+
}
|
|
4164
|
+
}[e.variant ?? "primary"] ?? {}
|
|
4165
|
+
};
|
|
4166
|
+
return e.href && !S ? /* @__PURE__ */ d("a", {
|
|
4167
|
+
href: e.href,
|
|
4168
|
+
target: e.target || void 0,
|
|
4169
|
+
rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
4170
|
+
style: t,
|
|
4171
|
+
children: e.label
|
|
4172
|
+
}, e.key) : /* @__PURE__ */ d("button", {
|
|
4173
|
+
type: "button",
|
|
4174
|
+
onClick: () => !S && w(!1),
|
|
4175
|
+
style: t,
|
|
4176
|
+
children: e.label
|
|
4177
|
+
}, e.key);
|
|
4178
|
+
}, O = Array.isArray(h) ? h : [], k = O.filter((e) => e.side === "left"), A = O.filter((e) => e.side !== "left"), j = g === !0 ? D({
|
|
4179
|
+
key: "__close",
|
|
4180
|
+
label: _ || "Close",
|
|
4181
|
+
variant: "outline"
|
|
4182
|
+
}) : null, M = k.length || A.length || j ? /* @__PURE__ */ f("div", {
|
|
4183
|
+
style: {
|
|
4184
|
+
display: "flex",
|
|
4185
|
+
alignItems: "center",
|
|
4186
|
+
gap: 8,
|
|
4187
|
+
padding: "14px 20px",
|
|
4188
|
+
borderTop: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))",
|
|
4189
|
+
justifyContent: k.length ? "space-between" : v === "left" ? "flex-start" : v === "center" ? "center" : "flex-end"
|
|
4190
|
+
},
|
|
4191
|
+
children: [k.length > 0 && /* @__PURE__ */ d("div", {
|
|
4192
|
+
style: {
|
|
4193
|
+
display: "flex",
|
|
4194
|
+
gap: 8
|
|
4195
|
+
},
|
|
4196
|
+
children: k.map(D)
|
|
4197
|
+
}), /* @__PURE__ */ f("div", {
|
|
4198
|
+
style: {
|
|
4199
|
+
display: "flex",
|
|
4200
|
+
gap: 8
|
|
4201
|
+
},
|
|
4202
|
+
children: [j, A.map(D)]
|
|
4203
|
+
})]
|
|
4204
|
+
}) : null, N = /* @__PURE__ */ f("div", {
|
|
4205
|
+
ref: T,
|
|
4206
|
+
role: "dialog",
|
|
4207
|
+
"aria-modal": S ? void 0 : "true",
|
|
4208
|
+
"aria-label": s || void 0,
|
|
4209
|
+
tabIndex: -1,
|
|
4210
|
+
onClick: (e) => e.stopPropagation(),
|
|
4211
|
+
style: {
|
|
4212
|
+
width: typeof E == "number" ? `min(${E}px, 100%)` : E,
|
|
4213
|
+
maxHeight: S ? void 0 : "85vh",
|
|
4214
|
+
overflowY: S ? void 0 : "auto",
|
|
4215
|
+
borderRadius: 12,
|
|
4216
|
+
background: "var(--page-surface, #ffffff)",
|
|
4217
|
+
color: "var(--page-text, #111827)",
|
|
4218
|
+
border: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))",
|
|
4219
|
+
boxShadow: S ? "none" : "0 24px 64px rgba(15, 23, 42, 0.35)",
|
|
4220
|
+
outline: "none",
|
|
4221
|
+
...P(b)
|
|
4222
|
+
},
|
|
4223
|
+
children: [
|
|
4224
|
+
(s || u !== !1) && /* @__PURE__ */ f("div", {
|
|
4225
|
+
style: {
|
|
4226
|
+
display: "flex",
|
|
4227
|
+
alignItems: "center",
|
|
4228
|
+
gap: 12,
|
|
4229
|
+
padding: "16px 20px",
|
|
4230
|
+
borderBottom: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))"
|
|
4231
|
+
},
|
|
4232
|
+
children: [/* @__PURE__ */ d("span", {
|
|
4233
|
+
style: {
|
|
4234
|
+
fontWeight: 700,
|
|
4235
|
+
fontSize: 17,
|
|
4236
|
+
flexGrow: 1,
|
|
4237
|
+
fontFamily: "var(--page-heading-font, inherit)"
|
|
4238
|
+
},
|
|
4239
|
+
children: s
|
|
4240
|
+
}), u !== !1 && /* @__PURE__ */ d("button", {
|
|
4241
|
+
type: "button",
|
|
4242
|
+
"aria-label": "Close",
|
|
4243
|
+
onClick: () => !S && w(!1),
|
|
4244
|
+
style: {
|
|
4245
|
+
background: "transparent",
|
|
4246
|
+
border: 0,
|
|
4247
|
+
color: "inherit",
|
|
4248
|
+
cursor: "pointer",
|
|
4249
|
+
fontSize: 20,
|
|
4250
|
+
lineHeight: 1,
|
|
4251
|
+
padding: 2,
|
|
4252
|
+
opacity: .7
|
|
4253
|
+
},
|
|
4254
|
+
children: "✕"
|
|
4255
|
+
})]
|
|
4256
|
+
}),
|
|
4257
|
+
/* @__PURE__ */ d("div", {
|
|
4258
|
+
style: { padding: 20 },
|
|
4259
|
+
children: y?.content
|
|
4260
|
+
}),
|
|
4261
|
+
M
|
|
4262
|
+
]
|
|
4263
|
+
});
|
|
4264
|
+
return /* @__PURE__ */ f("div", {
|
|
4265
|
+
ref: x,
|
|
4266
|
+
id: e || void 0,
|
|
4267
|
+
style: S ? void 0 : { display: "contents" },
|
|
4268
|
+
children: [t === "button" && /* @__PURE__ */ d("button", {
|
|
4269
|
+
type: "button",
|
|
4270
|
+
onClick: () => !S && w(!0),
|
|
4271
|
+
style: {
|
|
4272
|
+
padding: "10px 18px",
|
|
4273
|
+
border: 0,
|
|
4274
|
+
borderRadius: 6,
|
|
4275
|
+
cursor: "pointer",
|
|
4276
|
+
fontSize: 15,
|
|
4277
|
+
fontFamily: "inherit",
|
|
4278
|
+
background: "var(--page-accent, #4f46e5)",
|
|
4279
|
+
color: "var(--page-accent-text, #ffffff)"
|
|
4280
|
+
},
|
|
4281
|
+
children: n
|
|
4282
|
+
}), S ? /* @__PURE__ */ d("div", {
|
|
4283
|
+
style: { marginTop: t === "button" ? 12 : 0 },
|
|
4284
|
+
children: N
|
|
4285
|
+
}) : C && /* @__PURE__ */ d("div", {
|
|
4286
|
+
onClick: p === !1 ? void 0 : () => w(!1),
|
|
4287
|
+
style: {
|
|
4288
|
+
position: "fixed",
|
|
4289
|
+
inset: 0,
|
|
4290
|
+
zIndex: 2147483e3,
|
|
4291
|
+
display: "flex",
|
|
4292
|
+
alignItems: m === "top" ? "flex-start" : "center",
|
|
4293
|
+
justifyContent: "center",
|
|
4294
|
+
padding: 20,
|
|
4295
|
+
paddingTop: m === "top" ? "8vh" : 20,
|
|
4296
|
+
background: "rgba(15, 23, 42, 0.55)",
|
|
4297
|
+
backdropFilter: "blur(2px)"
|
|
4298
|
+
},
|
|
4299
|
+
children: N
|
|
4300
|
+
})]
|
|
4301
|
+
});
|
|
4302
|
+
}
|
|
4303
|
+
var wn = {
|
|
4304
|
+
PageRoot: Pe,
|
|
4305
|
+
CalendarBlock: xn,
|
|
4306
|
+
DialogBlock: Cn,
|
|
4307
|
+
Section: Fe,
|
|
4308
|
+
Container: Ie,
|
|
4309
|
+
Heading: Le,
|
|
4310
|
+
TextBlock: Je,
|
|
4311
|
+
ButtonBlock: Ze,
|
|
4312
|
+
ImageBlock: Qe,
|
|
4313
|
+
Spacer: it,
|
|
4314
|
+
Divider: at,
|
|
4315
|
+
SliderBlock: dt,
|
|
4316
|
+
CanvasSlider: ft,
|
|
4317
|
+
TabsBlock: vt,
|
|
4318
|
+
QuickStack: zt,
|
|
4319
|
+
CollectionList: Bt,
|
|
4320
|
+
CollectionSearch: Vt,
|
|
4321
|
+
BreadcrumbsBlock: Ht,
|
|
4322
|
+
PaginationBlock: Ut,
|
|
4323
|
+
StepperBlock: tn,
|
|
4324
|
+
SocialLinksBlock: en,
|
|
4325
|
+
ThemeModeBlock: Jt,
|
|
4326
|
+
ScrollTopBlock: Qt,
|
|
4327
|
+
OrgChartBlock: fn,
|
|
4328
|
+
TableBlock: pn,
|
|
4329
|
+
MasonryBlock: pt,
|
|
4330
|
+
AccordionBlock: yt,
|
|
4331
|
+
NavbarBlock: _t,
|
|
4332
|
+
ListBlock: qe,
|
|
4333
|
+
TextSpan: Be,
|
|
4334
|
+
QuoteBlock: Ke,
|
|
4335
|
+
TextLink: Xe,
|
|
4336
|
+
RichTextBlock: We,
|
|
4337
|
+
RichContentBlock: We,
|
|
4338
|
+
VideoBlock: $e,
|
|
4339
|
+
YouTubeBlock: tt,
|
|
4340
|
+
IframeBlock: nt,
|
|
4341
|
+
EmbedBlock: rt,
|
|
4342
|
+
FormBlock: Dt,
|
|
4343
|
+
FormLabel: Mt,
|
|
4344
|
+
FormInput: Nt,
|
|
4345
|
+
FormTextarea: Pt,
|
|
4346
|
+
FormCheckbox: (e) => /* @__PURE__ */ d(Ft, {
|
|
3664
4347
|
kind: "checkbox",
|
|
3665
4348
|
...e
|
|
3666
4349
|
}),
|
|
3667
|
-
FormRadio: (e) => /* @__PURE__ */ d(
|
|
4350
|
+
FormRadio: (e) => /* @__PURE__ */ d(Ft, {
|
|
3668
4351
|
kind: "radio",
|
|
3669
4352
|
...e
|
|
3670
4353
|
}),
|
|
3671
|
-
FormSelect:
|
|
3672
|
-
FormFile:
|
|
3673
|
-
FormRecaptcha:
|
|
3674
|
-
FormSubmit:
|
|
3675
|
-
},
|
|
4354
|
+
FormSelect: It,
|
|
4355
|
+
FormFile: Lt,
|
|
4356
|
+
FormRecaptcha: jt,
|
|
4357
|
+
FormSubmit: Rt
|
|
4358
|
+
}, Tn = {
|
|
3676
4359
|
id: "auth",
|
|
3677
4360
|
label: "Accounts",
|
|
3678
4361
|
category: "Apps",
|
|
3679
4362
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
3680
4363
|
ssr: "shell",
|
|
3681
4364
|
settings: ["site.authRedirect"]
|
|
3682
|
-
},
|
|
4365
|
+
}, En = n({
|
|
3683
4366
|
user: null,
|
|
3684
4367
|
status: "idle",
|
|
3685
4368
|
ensure: () => {},
|
|
3686
4369
|
refresh: () => {},
|
|
3687
4370
|
signOut: () => {}
|
|
3688
|
-
}),
|
|
3689
|
-
let e = i(
|
|
4371
|
+
}), Dn = () => {
|
|
4372
|
+
let e = i(En);
|
|
3690
4373
|
return a(() => {
|
|
3691
4374
|
e.ensure();
|
|
3692
4375
|
}, [e]), e;
|
|
3693
4376
|
};
|
|
3694
|
-
function
|
|
3695
|
-
let
|
|
4377
|
+
function On({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u }) {
|
|
4378
|
+
let f = i(K), p = o || f?.apiUrl || "/api", m = u || f?.tenant || "", [h, g] = l(t ?? null), [_, v] = l(t ? "user" : n ? "guest" : "idle"), y = c(!1), b = r((e, t) => fetch(`${p}${e}`, {
|
|
3696
4379
|
...t,
|
|
3697
4380
|
credentials: "include",
|
|
3698
4381
|
headers: {
|
|
3699
4382
|
"content-type": "application/json",
|
|
3700
|
-
...
|
|
4383
|
+
...m ? { "x-tenant": m } : {},
|
|
3701
4384
|
...t?.headers
|
|
3702
4385
|
}
|
|
3703
|
-
}), [
|
|
4386
|
+
}), [p, m]), x = r(() => n ? Promise.resolve(null) : b("/site/me").then((e) => e.ok ? e.json() : null).then((e) => {
|
|
3704
4387
|
let t = e?.payload ?? null;
|
|
3705
|
-
return
|
|
3706
|
-
}).catch(() => (
|
|
3707
|
-
|
|
3708
|
-
}), [
|
|
3709
|
-
|
|
4388
|
+
return g(t), v(t ? "user" : "guest"), t;
|
|
4389
|
+
}).catch(() => (g(null), v("guest"), null)), [b, n]), S = r(() => b("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
4390
|
+
g(null), v("guest");
|
|
4391
|
+
}), [b]), C = r(() => {
|
|
4392
|
+
y.current || n || t || (y.current = !0, v("loading"), x());
|
|
3710
4393
|
}, [
|
|
3711
4394
|
n,
|
|
3712
4395
|
t,
|
|
3713
|
-
b
|
|
3714
|
-
]), C = s(() => ({
|
|
3715
|
-
user: m,
|
|
3716
|
-
status: g,
|
|
3717
|
-
ensure: S,
|
|
3718
|
-
refresh: b,
|
|
3719
|
-
signOut: x
|
|
3720
|
-
}), [
|
|
3721
|
-
m,
|
|
3722
|
-
g,
|
|
3723
|
-
S,
|
|
3724
|
-
b,
|
|
3725
4396
|
x
|
|
4397
|
+
]), w = s(() => ({
|
|
4398
|
+
user: h,
|
|
4399
|
+
status: _,
|
|
4400
|
+
ensure: C,
|
|
4401
|
+
refresh: x,
|
|
4402
|
+
signOut: S
|
|
4403
|
+
}), [
|
|
4404
|
+
h,
|
|
4405
|
+
_,
|
|
4406
|
+
C,
|
|
4407
|
+
x,
|
|
4408
|
+
S
|
|
3726
4409
|
]);
|
|
3727
|
-
return
|
|
3728
|
-
|
|
4410
|
+
return a(() => {
|
|
4411
|
+
n || typeof window > "u" || (window.webim = {
|
|
4412
|
+
...window.webim,
|
|
4413
|
+
user: h,
|
|
4414
|
+
status: _,
|
|
4415
|
+
requireUser: () => y.current || t ? Promise.resolve(h) : x(),
|
|
4416
|
+
signOut: S
|
|
4417
|
+
}, window.dispatchEvent(new CustomEvent("webim:session", { detail: {
|
|
4418
|
+
user: h,
|
|
4419
|
+
status: _
|
|
4420
|
+
} })));
|
|
4421
|
+
}, [
|
|
4422
|
+
n,
|
|
4423
|
+
h,
|
|
4424
|
+
_,
|
|
4425
|
+
t,
|
|
4426
|
+
x,
|
|
4427
|
+
S
|
|
4428
|
+
]), /* @__PURE__ */ d(En.Provider, {
|
|
4429
|
+
value: w,
|
|
3729
4430
|
children: e
|
|
3730
4431
|
});
|
|
3731
4432
|
}
|
|
3732
|
-
function
|
|
3733
|
-
let { status: n } =
|
|
4433
|
+
function kn({ when: e, children: t }) {
|
|
4434
|
+
let { status: n } = Dn();
|
|
3734
4435
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
3735
4436
|
}
|
|
3736
4437
|
//#endregion
|
|
3737
4438
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
3738
|
-
function
|
|
3739
|
-
let { tenant: h, apiUrl: g, settings: _ } = i(
|
|
4439
|
+
function An({ 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 }) {
|
|
4440
|
+
let { tenant: h, apiUrl: g, settings: _ } = i(K), [v, y] = l("form"), [b, x] = l(""), [S, C] = l(!1), w = e === "register", T = u ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
|
|
3740
4441
|
if (e.preventDefault(), u) return;
|
|
3741
4442
|
let n = new FormData(e.currentTarget);
|
|
3742
4443
|
C(!0), x("");
|
|
@@ -3772,11 +4473,11 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3772
4473
|
display: "grid",
|
|
3773
4474
|
gap: 12,
|
|
3774
4475
|
maxWidth: 360,
|
|
3775
|
-
...
|
|
4476
|
+
...P(s)
|
|
3776
4477
|
},
|
|
3777
4478
|
children: [
|
|
3778
4479
|
/* @__PURE__ */ f("form", {
|
|
3779
|
-
onSubmit:
|
|
4480
|
+
onSubmit: D,
|
|
3780
4481
|
style: {
|
|
3781
4482
|
display: T === "form" ? "grid" : "none",
|
|
3782
4483
|
gap: 10
|
|
@@ -3784,20 +4485,20 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3784
4485
|
children: [
|
|
3785
4486
|
w ? /* @__PURE__ */ f("label", {
|
|
3786
4487
|
style: {
|
|
3787
|
-
...
|
|
4488
|
+
...Z,
|
|
3788
4489
|
display: "grid",
|
|
3789
4490
|
gap: 6
|
|
3790
4491
|
},
|
|
3791
4492
|
children: [a, /* @__PURE__ */ d("input", {
|
|
3792
4493
|
name: "name",
|
|
3793
4494
|
type: "text",
|
|
3794
|
-
style:
|
|
3795
|
-
|
|
4495
|
+
style: Q,
|
|
4496
|
+
...$(u)
|
|
3796
4497
|
})]
|
|
3797
4498
|
}) : null,
|
|
3798
4499
|
/* @__PURE__ */ f("label", {
|
|
3799
4500
|
style: {
|
|
3800
|
-
...
|
|
4501
|
+
...Z,
|
|
3801
4502
|
display: "grid",
|
|
3802
4503
|
gap: 6
|
|
3803
4504
|
},
|
|
@@ -3805,13 +4506,13 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3805
4506
|
name: "email",
|
|
3806
4507
|
type: "email",
|
|
3807
4508
|
required: !u,
|
|
3808
|
-
style:
|
|
3809
|
-
|
|
4509
|
+
style: Q,
|
|
4510
|
+
...$(u)
|
|
3810
4511
|
})]
|
|
3811
4512
|
}),
|
|
3812
4513
|
/* @__PURE__ */ f("label", {
|
|
3813
4514
|
style: {
|
|
3814
|
-
...
|
|
4515
|
+
...Z,
|
|
3815
4516
|
display: "grid",
|
|
3816
4517
|
gap: 6
|
|
3817
4518
|
},
|
|
@@ -3819,15 +4520,15 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3819
4520
|
name: "password",
|
|
3820
4521
|
type: "password",
|
|
3821
4522
|
required: !u,
|
|
3822
|
-
style:
|
|
3823
|
-
|
|
4523
|
+
style: Q,
|
|
4524
|
+
...$(u)
|
|
3824
4525
|
})]
|
|
3825
4526
|
}),
|
|
3826
4527
|
/* @__PURE__ */ d("button", {
|
|
3827
4528
|
type: u ? "button" : "submit",
|
|
3828
4529
|
disabled: S || void 0,
|
|
3829
4530
|
style: {
|
|
3830
|
-
...
|
|
4531
|
+
...Y,
|
|
3831
4532
|
border: 0,
|
|
3832
4533
|
padding: "10px 22px",
|
|
3833
4534
|
borderRadius: 8,
|
|
@@ -3859,8 +4560,8 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3859
4560
|
]
|
|
3860
4561
|
});
|
|
3861
4562
|
}
|
|
3862
|
-
function
|
|
3863
|
-
let { user: c, status: l, signOut: u } =
|
|
4563
|
+
function jn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
4564
|
+
let { user: c, status: l, signOut: u } = Dn(), p = a ? s || "user" : l, m = a ? {
|
|
3864
4565
|
name: "Ada Lovelace",
|
|
3865
4566
|
email: "ada@example.com"
|
|
3866
4567
|
} : c;
|
|
@@ -3868,7 +4569,7 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3868
4569
|
ref: i,
|
|
3869
4570
|
style: {
|
|
3870
4571
|
minHeight: 24,
|
|
3871
|
-
...
|
|
4572
|
+
...P(r)
|
|
3872
4573
|
}
|
|
3873
4574
|
}) : p === "user" ? /* @__PURE__ */ f("div", {
|
|
3874
4575
|
ref: i,
|
|
@@ -3876,12 +4577,12 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3876
4577
|
display: "flex",
|
|
3877
4578
|
alignItems: "center",
|
|
3878
4579
|
gap: 10,
|
|
3879
|
-
...
|
|
4580
|
+
...P(r)
|
|
3880
4581
|
},
|
|
3881
4582
|
children: [
|
|
3882
4583
|
/* @__PURE__ */ f("span", {
|
|
3883
4584
|
style: {
|
|
3884
|
-
...
|
|
4585
|
+
...Z,
|
|
3885
4586
|
fontWeight: 600
|
|
3886
4587
|
},
|
|
3887
4588
|
children: [
|
|
@@ -3892,7 +4593,7 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3892
4593
|
}),
|
|
3893
4594
|
n && m?.email ? /* @__PURE__ */ d("span", {
|
|
3894
4595
|
style: {
|
|
3895
|
-
...
|
|
4596
|
+
...Z,
|
|
3896
4597
|
opacity: .7
|
|
3897
4598
|
},
|
|
3898
4599
|
children: m.email
|
|
@@ -3901,14 +4602,14 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3901
4602
|
type: "button",
|
|
3902
4603
|
onClick: a ? void 0 : u,
|
|
3903
4604
|
style: {
|
|
3904
|
-
...
|
|
4605
|
+
...Y,
|
|
3905
4606
|
border: 0,
|
|
3906
4607
|
padding: "8px 16px",
|
|
3907
4608
|
borderRadius: 8,
|
|
3908
4609
|
fontSize: 14,
|
|
3909
4610
|
cursor: a ? "default" : "pointer"
|
|
3910
4611
|
},
|
|
3911
|
-
|
|
4612
|
+
...$(a),
|
|
3912
4613
|
children: t
|
|
3913
4614
|
})
|
|
3914
4615
|
]
|
|
@@ -3918,47 +4619,47 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3918
4619
|
display: "flex",
|
|
3919
4620
|
alignItems: "center",
|
|
3920
4621
|
gap: 10,
|
|
3921
|
-
...
|
|
4622
|
+
...P(r)
|
|
3922
4623
|
},
|
|
3923
4624
|
children: o?.signedOut ?? null
|
|
3924
4625
|
});
|
|
3925
4626
|
}
|
|
3926
4627
|
//#endregion
|
|
3927
4628
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
3928
|
-
var
|
|
4629
|
+
var Mn = {
|
|
3929
4630
|
id: "consent",
|
|
3930
4631
|
label: "Cookie consent",
|
|
3931
4632
|
category: "Apps",
|
|
3932
4633
|
keys: ["CookieConsent"],
|
|
3933
4634
|
ssr: "shell",
|
|
3934
4635
|
settings: []
|
|
3935
|
-
},
|
|
3936
|
-
function
|
|
4636
|
+
}, Nn = "webim.cookie_consent";
|
|
4637
|
+
function Pn() {
|
|
3937
4638
|
try {
|
|
3938
|
-
let e = window.localStorage.getItem(
|
|
4639
|
+
let e = window.localStorage.getItem(Nn), t = e ? JSON.parse(e) : null;
|
|
3939
4640
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
3940
4641
|
} catch {
|
|
3941
4642
|
return "";
|
|
3942
4643
|
}
|
|
3943
4644
|
}
|
|
3944
|
-
function
|
|
4645
|
+
function Fn(e) {
|
|
3945
4646
|
try {
|
|
3946
4647
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
3947
4648
|
} catch {}
|
|
3948
4649
|
}
|
|
3949
|
-
function
|
|
4650
|
+
function In(e) {
|
|
3950
4651
|
try {
|
|
3951
|
-
window.localStorage.setItem(
|
|
4652
|
+
window.localStorage.setItem(Nn, JSON.stringify({
|
|
3952
4653
|
choice: e,
|
|
3953
4654
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3954
4655
|
}));
|
|
3955
4656
|
} catch {}
|
|
3956
|
-
|
|
4657
|
+
Fn(e);
|
|
3957
4658
|
try {
|
|
3958
4659
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
3959
4660
|
} catch {}
|
|
3960
4661
|
}
|
|
3961
|
-
var
|
|
4662
|
+
var Ln = {
|
|
3962
4663
|
bottom: {
|
|
3963
4664
|
left: 0,
|
|
3964
4665
|
right: 0,
|
|
@@ -3980,21 +4681,18 @@ var hn = {
|
|
|
3980
4681
|
maxWidth: 400
|
|
3981
4682
|
}
|
|
3982
4683
|
};
|
|
3983
|
-
function
|
|
4684
|
+
function Rn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: o, position: s, linked: c, style: p, nodeRef: m, inert: h }) {
|
|
3984
4685
|
let [g, _] = l(!!h), [v, y] = l(null), b = (e) => {
|
|
3985
4686
|
y(e), typeof m == "function" && m(e);
|
|
3986
4687
|
};
|
|
3987
4688
|
if (a(() => {
|
|
3988
4689
|
if (h) return;
|
|
3989
|
-
let e =
|
|
3990
|
-
|
|
3991
|
-
let t = v?.closest?.(".webim-page");
|
|
3992
|
-
t && t.setAttribute("data-webim-consent", e);
|
|
3993
|
-
} else _(!0);
|
|
4690
|
+
let e = Pn();
|
|
4691
|
+
e ? Fn(e) : _(!0);
|
|
3994
4692
|
}, [h, v]), !g) return null;
|
|
3995
4693
|
let x = (e) => () => {
|
|
3996
|
-
h || (
|
|
3997
|
-
}, S =
|
|
4694
|
+
h || (In(e), _(!1));
|
|
4695
|
+
}, S = Ln[s] ?? Ln.bottom, C = {
|
|
3998
4696
|
appearance: "none",
|
|
3999
4697
|
font: "inherit",
|
|
4000
4698
|
fontSize: 14,
|
|
@@ -4026,7 +4724,7 @@ function gn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
4026
4724
|
boxShadow: "0 8px 30px rgba(15, 23, 42, 0.18)",
|
|
4027
4725
|
fontSize: 14,
|
|
4028
4726
|
lineHeight: 1.5,
|
|
4029
|
-
...
|
|
4727
|
+
...P(p)
|
|
4030
4728
|
},
|
|
4031
4729
|
children: [/* @__PURE__ */ f("div", {
|
|
4032
4730
|
style: {
|
|
@@ -4074,31 +4772,251 @@ function gn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
4074
4772
|
}
|
|
4075
4773
|
//#endregion
|
|
4076
4774
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
4077
|
-
var
|
|
4775
|
+
var zn = {
|
|
4078
4776
|
id: "language",
|
|
4079
4777
|
label: "Language",
|
|
4080
4778
|
category: "Apps",
|
|
4081
4779
|
keys: ["SiteLanguagePicker"],
|
|
4082
4780
|
ssr: "prefetch",
|
|
4083
4781
|
settings: ["locales"]
|
|
4084
|
-
}
|
|
4782
|
+
}, Bn = {
|
|
4783
|
+
id: "search",
|
|
4784
|
+
label: "Search",
|
|
4785
|
+
category: "Apps",
|
|
4786
|
+
keys: ["SiteSearch"],
|
|
4787
|
+
ssr: "prefetch",
|
|
4788
|
+
settings: []
|
|
4789
|
+
}, Vn = 50, Hn = 2e3;
|
|
4790
|
+
function Un() {
|
|
4791
|
+
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
4792
|
+
}
|
|
4793
|
+
function Wn(e, t) {
|
|
4794
|
+
let n = e?.data ?? {}, r = [];
|
|
4795
|
+
for (let e of Object.values(n)) {
|
|
4796
|
+
let t = e == null ? "" : J(e);
|
|
4797
|
+
if (t && r.push(t), r.join(" ").length > Hn) break;
|
|
4798
|
+
}
|
|
4799
|
+
return r.join(" ").slice(0, Hn).toLocaleLowerCase(t || void 0);
|
|
4800
|
+
}
|
|
4801
|
+
function Gn({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: r = !1, layout: o = "inline", includePages: s = !0, collections: u = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
|
|
4802
|
+
let { tenant: b, apiUrl: x, locale: S } = i(K), [C, w] = l(() => Un()), [T, E] = l(() => Un()), [D, O] = l(null), [k, A] = l(!1), j = c(null), M = o === "popup";
|
|
4803
|
+
a(() => {
|
|
4804
|
+
let e = () => {
|
|
4805
|
+
let e = Un();
|
|
4806
|
+
w(e), E(e);
|
|
4807
|
+
};
|
|
4808
|
+
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
4809
|
+
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
4810
|
+
};
|
|
4811
|
+
}, []), a(() => {
|
|
4812
|
+
if (!r) return;
|
|
4813
|
+
let e = setTimeout(() => {
|
|
4814
|
+
w(T), T.trim() && A(!0);
|
|
4815
|
+
}, 200);
|
|
4816
|
+
return () => clearTimeout(e);
|
|
4817
|
+
}, [r, T]), a(() => {
|
|
4818
|
+
if (!M) return;
|
|
4819
|
+
let e = (e) => {
|
|
4820
|
+
j.current && !j.current.contains(e.target) && A(!1);
|
|
4821
|
+
}, t = (e) => e.key === "Escape" && A(!1);
|
|
4822
|
+
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
4823
|
+
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
4824
|
+
};
|
|
4825
|
+
}, [M]), a(() => {
|
|
4826
|
+
let e = !0, t = b ? { "x-tenant": b } : {}, n = (e) => fetch(`${x}${e}`, { headers: t }).then((e) => e.json()).then((e) => e?.payload).catch(() => null), r = [s ? n("/site/pages").then((e) => ({
|
|
4827
|
+
kind: "page",
|
|
4828
|
+
rows: Array.isArray(e) ? e : []
|
|
4829
|
+
})) : null, ...(Array.isArray(u) ? u : []).filter(Boolean).map((e) => n(`/dynamic/${encodeURIComponent(e)}?all=1${S ? `&locale=${encodeURIComponent(S)}` : ""}`).then((t) => ({
|
|
4830
|
+
kind: "entry",
|
|
4831
|
+
slug: e,
|
|
4832
|
+
rows: Array.isArray(t) ? t : Array.isArray(t?.data) ? t.data : []
|
|
4833
|
+
})))].filter(Boolean);
|
|
4834
|
+
return Promise.all(r).then((t) => e && O(t)), () => {
|
|
4835
|
+
e = !1;
|
|
4836
|
+
};
|
|
4837
|
+
}, [
|
|
4838
|
+
x,
|
|
4839
|
+
b,
|
|
4840
|
+
S,
|
|
4841
|
+
s,
|
|
4842
|
+
JSON.stringify(u)
|
|
4843
|
+
]);
|
|
4844
|
+
let N = C.trim().toLocaleLowerCase(S || void 0), F = [];
|
|
4845
|
+
if (N && D) for (let e of D) if (e.kind === "page") for (let t of e.rows) {
|
|
4846
|
+
if (t?.access && t.access !== "public") continue;
|
|
4847
|
+
let e = String(t?.title ?? "");
|
|
4848
|
+
`${e} ${t?.slug ?? ""}`.toLocaleLowerCase(S || void 0).includes(N) && F.push({
|
|
4849
|
+
key: `page:${t.slug}`,
|
|
4850
|
+
title: e || t.slug,
|
|
4851
|
+
url: `/${t.slug}`,
|
|
4852
|
+
kind: "page"
|
|
4853
|
+
});
|
|
4854
|
+
}
|
|
4855
|
+
else for (let t of e.rows) {
|
|
4856
|
+
if (!Wn(t, S).includes(N)) continue;
|
|
4857
|
+
let n = t?.data ?? {}, r = J(n.name) || "Untitled", i = J(n.slug);
|
|
4858
|
+
F.push({
|
|
4859
|
+
key: `entry:${t.id}`,
|
|
4860
|
+
title: r,
|
|
4861
|
+
url: i ? `/${e.slug}/${i}` : `/${e.slug}`,
|
|
4862
|
+
kind: "entry"
|
|
4863
|
+
});
|
|
4864
|
+
}
|
|
4865
|
+
let I = F.slice(0, Math.min(Math.max(1, p), Vn)), L = (e) => {
|
|
4866
|
+
if (v) {
|
|
4867
|
+
e.preventDefault(), w(T), A(!0);
|
|
4868
|
+
return;
|
|
4869
|
+
}
|
|
4870
|
+
if (typeof window > "u" || !window.history?.pushState) return;
|
|
4871
|
+
e.preventDefault();
|
|
4872
|
+
let t = new URLSearchParams(window.location.search);
|
|
4873
|
+
T.trim() ? t.set("q", T.trim()) : t.delete("q"), t.delete("page");
|
|
4874
|
+
let n = t.toString();
|
|
4875
|
+
window.history.pushState({}, "", `${window.location.pathname}${n ? `?${n}` : ""}`), window.dispatchEvent(new Event("webim:urlchange")), A(!0);
|
|
4876
|
+
}, R = y && !N ? [{
|
|
4877
|
+
key: "sample-1",
|
|
4878
|
+
title: "About us",
|
|
4879
|
+
url: "/about",
|
|
4880
|
+
kind: "page"
|
|
4881
|
+
}, {
|
|
4882
|
+
key: "sample-2",
|
|
4883
|
+
title: "Spring collection",
|
|
4884
|
+
url: "/blog/spring",
|
|
4885
|
+
kind: "entry"
|
|
4886
|
+
}] : null, z = R ?? I, B = !R && N && D && !I.length, V = !M || k && (z.length > 0 || B), H = z.length > 0 && /* @__PURE__ */ d("ul", {
|
|
4887
|
+
style: {
|
|
4888
|
+
listStyle: "none",
|
|
4889
|
+
margin: 0,
|
|
4890
|
+
padding: 0,
|
|
4891
|
+
display: "flex",
|
|
4892
|
+
flexDirection: "column",
|
|
4893
|
+
gap: 2
|
|
4894
|
+
},
|
|
4895
|
+
children: z.map((e) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ f("a", {
|
|
4896
|
+
href: v ? void 0 : e.url,
|
|
4897
|
+
style: {
|
|
4898
|
+
display: "block",
|
|
4899
|
+
padding: "10px 12px",
|
|
4900
|
+
borderRadius: 6,
|
|
4901
|
+
color: "inherit",
|
|
4902
|
+
textDecoration: "none",
|
|
4903
|
+
border: M ? 0 : "1px solid var(--page-border, rgba(148, 163, 184, 0.35))"
|
|
4904
|
+
},
|
|
4905
|
+
children: [/* @__PURE__ */ d("span", {
|
|
4906
|
+
style: {
|
|
4907
|
+
display: "block",
|
|
4908
|
+
fontWeight: 600
|
|
4909
|
+
},
|
|
4910
|
+
children: e.title
|
|
4911
|
+
}), /* @__PURE__ */ d("span", {
|
|
4912
|
+
style: {
|
|
4913
|
+
display: "block",
|
|
4914
|
+
fontSize: 12,
|
|
4915
|
+
opacity: .6
|
|
4916
|
+
},
|
|
4917
|
+
children: e.url
|
|
4918
|
+
})]
|
|
4919
|
+
}) }, e.key))
|
|
4920
|
+
});
|
|
4921
|
+
return /* @__PURE__ */ d("div", {
|
|
4922
|
+
ref: _,
|
|
4923
|
+
style: {
|
|
4924
|
+
width: "100%",
|
|
4925
|
+
...P(g)
|
|
4926
|
+
},
|
|
4927
|
+
children: /* @__PURE__ */ f("div", {
|
|
4928
|
+
ref: j,
|
|
4929
|
+
style: { position: "relative" },
|
|
4930
|
+
children: [
|
|
4931
|
+
/* @__PURE__ */ f("form", {
|
|
4932
|
+
method: "get",
|
|
4933
|
+
onSubmit: L,
|
|
4934
|
+
style: {
|
|
4935
|
+
display: "flex",
|
|
4936
|
+
gap: 8,
|
|
4937
|
+
alignItems: "center"
|
|
4938
|
+
},
|
|
4939
|
+
children: [/* @__PURE__ */ d("input", {
|
|
4940
|
+
type: "search",
|
|
4941
|
+
name: "q",
|
|
4942
|
+
value: T,
|
|
4943
|
+
placeholder: e,
|
|
4944
|
+
onChange: (e) => E(e.target.value),
|
|
4945
|
+
onFocus: () => N && A(!0),
|
|
4946
|
+
style: {
|
|
4947
|
+
...Q,
|
|
4948
|
+
flexGrow: 1,
|
|
4949
|
+
minWidth: 0
|
|
4950
|
+
}
|
|
4951
|
+
}), n !== !1 && /* @__PURE__ */ d("button", {
|
|
4952
|
+
type: "submit",
|
|
4953
|
+
style: {
|
|
4954
|
+
padding: "10px 16px",
|
|
4955
|
+
border: 0,
|
|
4956
|
+
borderRadius: 6,
|
|
4957
|
+
cursor: "pointer",
|
|
4958
|
+
fontSize: 14,
|
|
4959
|
+
fontFamily: "inherit",
|
|
4960
|
+
background: "var(--page-accent, #4f46e5)",
|
|
4961
|
+
color: "var(--page-accent-text, #ffffff)"
|
|
4962
|
+
},
|
|
4963
|
+
children: t
|
|
4964
|
+
})]
|
|
4965
|
+
}),
|
|
4966
|
+
h && /* @__PURE__ */ d("div", {
|
|
4967
|
+
style: {
|
|
4968
|
+
fontSize: 13,
|
|
4969
|
+
opacity: .65,
|
|
4970
|
+
marginTop: 6
|
|
4971
|
+
},
|
|
4972
|
+
children: h
|
|
4973
|
+
}),
|
|
4974
|
+
V && /* @__PURE__ */ f("div", {
|
|
4975
|
+
style: M ? {
|
|
4976
|
+
position: "absolute",
|
|
4977
|
+
top: "100%",
|
|
4978
|
+
left: 0,
|
|
4979
|
+
right: 0,
|
|
4980
|
+
zIndex: 30,
|
|
4981
|
+
marginTop: 6,
|
|
4982
|
+
padding: 6,
|
|
4983
|
+
maxHeight: 320,
|
|
4984
|
+
overflowY: "auto",
|
|
4985
|
+
borderRadius: 8,
|
|
4986
|
+
border: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))",
|
|
4987
|
+
background: "var(--page-surface, #f2f2f2)",
|
|
4988
|
+
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.18)"
|
|
4989
|
+
} : { marginTop: 14 },
|
|
4990
|
+
children: [H, B && /* @__PURE__ */ d("div", {
|
|
4991
|
+
style: {
|
|
4992
|
+
fontSize: 14,
|
|
4993
|
+
opacity: .65,
|
|
4994
|
+
padding: M ? "10px 12px" : 0
|
|
4995
|
+
},
|
|
4996
|
+
children: m
|
|
4997
|
+
})]
|
|
4998
|
+
})
|
|
4999
|
+
]
|
|
5000
|
+
})
|
|
5001
|
+
});
|
|
5002
|
+
}
|
|
4085
5003
|
//#endregion
|
|
4086
5004
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
4087
|
-
function
|
|
5005
|
+
function Kn(e) {
|
|
4088
5006
|
let t = e?.locales, n = [typeof t?.default == "string" && t.default.trim() ? t.default.trim() : "", ...Array.isArray(t?.enabled) ? t.enabled : []].filter((e) => typeof e == "string" && e.trim());
|
|
4089
5007
|
return [...new Set(n.map((e) => e.trim()))];
|
|
4090
5008
|
}
|
|
4091
|
-
var
|
|
4092
|
-
function
|
|
5009
|
+
var qn = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
5010
|
+
function Jn(e, t) {
|
|
4093
5011
|
let n = String(e ?? "").toUpperCase();
|
|
4094
5012
|
if (t === "code") return n;
|
|
4095
5013
|
let r = "";
|
|
4096
5014
|
try {
|
|
4097
|
-
r =
|
|
5015
|
+
r = qn(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
4098
5016
|
} catch {}
|
|
4099
5017
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
4100
5018
|
}
|
|
4101
|
-
function
|
|
5019
|
+
function Yn(e, t) {
|
|
4102
5020
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
4103
5021
|
if (typeof window > "u") return n || "?";
|
|
4104
5022
|
try {
|
|
@@ -4108,12 +5026,12 @@ function xn(e, t) {
|
|
|
4108
5026
|
return n || "/";
|
|
4109
5027
|
}
|
|
4110
5028
|
}
|
|
4111
|
-
function
|
|
4112
|
-
let c = i(
|
|
5029
|
+
function Xn({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: s }) {
|
|
5030
|
+
let c = i(K), l = Kn(c?.settings), u = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : u, m = {
|
|
4113
5031
|
display: "inline-flex",
|
|
4114
5032
|
alignItems: "center",
|
|
4115
5033
|
gap: 8,
|
|
4116
|
-
...
|
|
5034
|
+
...P(a)
|
|
4117
5035
|
};
|
|
4118
5036
|
if (l.length < 2) return s ? /* @__PURE__ */ d("div", {
|
|
4119
5037
|
ref: o,
|
|
@@ -4144,7 +5062,7 @@ function Sn({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
4144
5062
|
style: { opacity: .4 },
|
|
4145
5063
|
children: n ?? "·"
|
|
4146
5064
|
}), /* @__PURE__ */ d("a", {
|
|
4147
|
-
href:
|
|
5065
|
+
href: Yn(e, e === u),
|
|
4148
5066
|
hrefLang: e,
|
|
4149
5067
|
"aria-current": e === p ? "true" : void 0,
|
|
4150
5068
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -4154,7 +5072,7 @@ function Sn({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
4154
5072
|
textDecoration: "none",
|
|
4155
5073
|
cursor: s ? "default" : "pointer"
|
|
4156
5074
|
},
|
|
4157
|
-
children:
|
|
5075
|
+
children: Jn(e, t)
|
|
4158
5076
|
})]
|
|
4159
5077
|
}, e))]
|
|
4160
5078
|
}) : /* @__PURE__ */ f("div", {
|
|
@@ -4165,7 +5083,7 @@ function Sn({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
4165
5083
|
value: p,
|
|
4166
5084
|
onChange: s ? void 0 : (e) => {
|
|
4167
5085
|
let t = e.target.value;
|
|
4168
|
-
window.location.assign(
|
|
5086
|
+
window.location.assign(Yn(t, t === u));
|
|
4169
5087
|
},
|
|
4170
5088
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
4171
5089
|
style: {
|
|
@@ -4179,55 +5097,57 @@ function Sn({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
4179
5097
|
},
|
|
4180
5098
|
children: l.map((e) => /* @__PURE__ */ d("option", {
|
|
4181
5099
|
value: e,
|
|
4182
|
-
children:
|
|
5100
|
+
children: Jn(e, t)
|
|
4183
5101
|
}, e))
|
|
4184
5102
|
})]
|
|
4185
5103
|
});
|
|
4186
5104
|
}
|
|
4187
5105
|
//#endregion
|
|
4188
5106
|
//#region ../ui/src/components/builder/apps/index.js
|
|
4189
|
-
var
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
5107
|
+
var Zn = [
|
|
5108
|
+
Tn,
|
|
5109
|
+
zn,
|
|
5110
|
+
Mn,
|
|
5111
|
+
Bn
|
|
5112
|
+
], Qn = {
|
|
5113
|
+
SiteLoginForm: An,
|
|
5114
|
+
SiteAccountMenu: jn,
|
|
5115
|
+
SiteLanguagePicker: Xn,
|
|
5116
|
+
CookieConsent: Rn,
|
|
5117
|
+
SiteSearch: Gn
|
|
4198
5118
|
};
|
|
4199
|
-
new Set(
|
|
5119
|
+
new Set(Zn.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
4200
5120
|
//#endregion
|
|
4201
5121
|
//#region ../ui/src/components/builder/plugins/runtime.js
|
|
4202
|
-
var
|
|
4203
|
-
function
|
|
4204
|
-
if (
|
|
5122
|
+
var $n = /* @__PURE__ */ new Map();
|
|
5123
|
+
function er(e) {
|
|
5124
|
+
if ($n.has(e)) return $n.get(e);
|
|
4205
5125
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
4206
5126
|
/* @vite-ignore */
|
|
4207
5127
|
/* webpackIgnore: true */
|
|
4208
5128
|
t
|
|
4209
5129
|
).finally(() => URL.revokeObjectURL(t));
|
|
4210
|
-
return
|
|
5130
|
+
return $n.set(e, n), n;
|
|
4211
5131
|
}
|
|
4212
|
-
function
|
|
5132
|
+
function tr(e) {
|
|
4213
5133
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
4214
5134
|
return n && typeof n == "object" ? n : {};
|
|
4215
5135
|
}
|
|
4216
5136
|
//#endregion
|
|
4217
5137
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
4218
|
-
async function
|
|
4219
|
-
let n = await
|
|
5138
|
+
async function nr(e, t) {
|
|
5139
|
+
let n = await er(e);
|
|
4220
5140
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
4221
5141
|
}
|
|
4222
|
-
var
|
|
5142
|
+
var rr = {
|
|
4223
5143
|
padding: "10px 12px",
|
|
4224
5144
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
4225
5145
|
borderRadius: 8,
|
|
4226
5146
|
fontSize: 12,
|
|
4227
5147
|
opacity: .6
|
|
4228
5148
|
};
|
|
4229
|
-
function
|
|
4230
|
-
let s = i(
|
|
5149
|
+
function ir({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
5150
|
+
let s = i(K), l = tr(s?.settings)[e], u = c(null), p = c(null), m = {
|
|
4231
5151
|
tenant: s?.tenant ?? "",
|
|
4232
5152
|
apiUrl: s?.apiUrl ?? "/api",
|
|
4233
5153
|
locale: s?.locale ?? "",
|
|
@@ -4239,7 +5159,7 @@ function An({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
4239
5159
|
let e = u.current;
|
|
4240
5160
|
if (!l?.code || !e) return;
|
|
4241
5161
|
let n = !0;
|
|
4242
|
-
return
|
|
5162
|
+
return nr(l.code, t).then((e) => {
|
|
4243
5163
|
if (!(!n || !e || !u.current)) {
|
|
4244
5164
|
p.current = e;
|
|
4245
5165
|
try {
|
|
@@ -4264,13 +5184,13 @@ function An({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
4264
5184
|
} catch {}
|
|
4265
5185
|
}, [g]), l ? /* @__PURE__ */ d("div", {
|
|
4266
5186
|
ref: o,
|
|
4267
|
-
style:
|
|
5187
|
+
style: P(r),
|
|
4268
5188
|
children: /* @__PURE__ */ d("div", { ref: u })
|
|
4269
5189
|
}) : /* @__PURE__ */ f("div", {
|
|
4270
5190
|
ref: o,
|
|
4271
5191
|
style: {
|
|
4272
|
-
...
|
|
4273
|
-
...
|
|
5192
|
+
...rr,
|
|
5193
|
+
...P(r)
|
|
4274
5194
|
},
|
|
4275
5195
|
children: [
|
|
4276
5196
|
"Plugin “",
|
|
@@ -4281,12 +5201,12 @@ function An({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
4281
5201
|
}
|
|
4282
5202
|
//#endregion
|
|
4283
5203
|
//#region ../ui/src/components/builder/render.jsx
|
|
4284
|
-
var
|
|
4285
|
-
...tn,
|
|
5204
|
+
var ar = {
|
|
4286
5205
|
...wn,
|
|
4287
|
-
|
|
5206
|
+
...Qn,
|
|
5207
|
+
PluginBlock: ir
|
|
4288
5208
|
};
|
|
4289
|
-
function
|
|
5209
|
+
function or(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
4290
5210
|
let o = n[e];
|
|
4291
5211
|
if (!o || o.hidden) return null;
|
|
4292
5212
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -4294,111 +5214,113 @@ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
4294
5214
|
let n = o.props?.componentId, s = r?.[n];
|
|
4295
5215
|
if (!s?.template || i.has(n)) return null;
|
|
4296
5216
|
let c = new Set(i).add(n);
|
|
4297
|
-
return /* @__PURE__ */ d(t, { children:
|
|
5217
|
+
return /* @__PURE__ */ d(t, { children: or(s.template.rootId, s.template.nodes, r, c, a) }, e);
|
|
4298
5218
|
}
|
|
4299
|
-
let l =
|
|
5219
|
+
let l = ar[s];
|
|
4300
5220
|
if (!l) return null;
|
|
4301
|
-
let u = (o.nodes ?? []).map((e) =>
|
|
5221
|
+
let u = (o.nodes ?? []).map((e) => or(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, or(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ d(l, {
|
|
4302
5222
|
...c,
|
|
4303
5223
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
4304
5224
|
linked: p,
|
|
4305
5225
|
nodeRef: (t) => {
|
|
4306
|
-
t && (t.setAttribute("data-wb", e),
|
|
5226
|
+
t && (t.setAttribute("data-wb", e), te(t, c), ee(t, a?.events === !1 ? [] : c.events));
|
|
4307
5227
|
},
|
|
4308
5228
|
children: u.length ? u : void 0
|
|
4309
5229
|
}, e);
|
|
4310
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ d(
|
|
5230
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ d(kn, {
|
|
4311
5231
|
when: c.when,
|
|
4312
5232
|
children: m
|
|
4313
5233
|
}, e) : m;
|
|
4314
5234
|
}
|
|
4315
5235
|
//#endregion
|
|
4316
5236
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
4317
|
-
var
|
|
4318
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
4319
|
-
function
|
|
4320
|
-
let
|
|
5237
|
+
var sr = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), cr = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(he(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
5238
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(he(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
5239
|
+
function lr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, animations: c, tenant: l, apiUrl: u, datasets: p, locale: m, direction: g, settings: _, siteUser: v }) {
|
|
5240
|
+
let y = o?.js?.trim();
|
|
4321
5241
|
if (a(() => {
|
|
4322
|
-
if (!
|
|
5242
|
+
if (!y) return;
|
|
4323
5243
|
let e = document.createElement("script");
|
|
4324
|
-
return e.text =
|
|
4325
|
-
}, [
|
|
4326
|
-
let
|
|
4327
|
-
lang:
|
|
4328
|
-
dir: h(
|
|
4329
|
-
}, x = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }",
|
|
5244
|
+
return e.text = y, document.body.appendChild(e), () => e.remove();
|
|
5245
|
+
}, [y]), !e?.ROOT) return null;
|
|
5246
|
+
let b = {
|
|
5247
|
+
lang: m || void 0,
|
|
5248
|
+
dir: h(g, m)
|
|
5249
|
+
}, x = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", C = {
|
|
4330
5250
|
minHeight: "100%",
|
|
4331
5251
|
display: "flex",
|
|
4332
5252
|
flexDirection: "column"
|
|
4333
|
-
}, w =
|
|
5253
|
+
}, w = or("ROOT", e, n), T = s(() => ({ render: (t, r) => or(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = ce(e, n), O = se(e, n), k = o?.css?.trim(), j = S(c), M = me(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !de[e]), P = [.../* @__PURE__ */ new Set([...A(e, n), ...N])].map((e) => /* @__PURE__ */ d("link", {
|
|
4334
5254
|
rel: "stylesheet",
|
|
4335
5255
|
precedence: "default",
|
|
4336
|
-
href:
|
|
4337
|
-
}, e)),
|
|
4338
|
-
return r === "auto" ? /* @__PURE__ */ d(
|
|
5256
|
+
href: D(e)
|
|
5257
|
+
}, e)), F = cr(M);
|
|
5258
|
+
return r === "auto" ? /* @__PURE__ */ d(K.Provider, {
|
|
4339
5259
|
value: {
|
|
4340
|
-
tenant:
|
|
4341
|
-
apiUrl:
|
|
4342
|
-
locale:
|
|
4343
|
-
settings:
|
|
5260
|
+
tenant: l || "",
|
|
5261
|
+
apiUrl: u || "/api",
|
|
5262
|
+
locale: m || "",
|
|
5263
|
+
settings: _ ?? null
|
|
4344
5264
|
},
|
|
4345
|
-
children: /* @__PURE__ */ d(
|
|
4346
|
-
initialUser:
|
|
4347
|
-
children: /* @__PURE__ */ d(
|
|
4348
|
-
value:
|
|
4349
|
-
children: /* @__PURE__ */ d(
|
|
5265
|
+
children: /* @__PURE__ */ d(On, {
|
|
5266
|
+
initialUser: v,
|
|
5267
|
+
children: /* @__PURE__ */ d(q.Provider, {
|
|
5268
|
+
value: p ?? null,
|
|
5269
|
+
children: /* @__PURE__ */ d(Ce.Provider, {
|
|
4350
5270
|
value: T,
|
|
4351
5271
|
children: /* @__PURE__ */ f("div", {
|
|
4352
|
-
...
|
|
5272
|
+
...b,
|
|
4353
5273
|
className: "webim-page",
|
|
4354
5274
|
style: {
|
|
4355
|
-
...
|
|
4356
|
-
...
|
|
5275
|
+
...C,
|
|
5276
|
+
...ge(t),
|
|
4357
5277
|
...i
|
|
4358
5278
|
},
|
|
4359
5279
|
children: [
|
|
4360
|
-
/* @__PURE__ */ d("style", { children: `.webim-page { ${
|
|
4361
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
4362
|
-
/* @__PURE__ */ d("style", { children:
|
|
4363
|
-
|
|
5280
|
+
/* @__PURE__ */ d("style", { children: `.webim-page { ${sr(he(M.light))} }
|
|
5281
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${sr(he(M.dark))} } }` }),
|
|
5282
|
+
/* @__PURE__ */ d("style", { children: F }),
|
|
5283
|
+
P,
|
|
4364
5284
|
/* @__PURE__ */ d("style", { children: x }),
|
|
4365
5285
|
E && /* @__PURE__ */ d("style", { children: E }),
|
|
4366
|
-
D && /* @__PURE__ */ d("style", { children: D }),
|
|
4367
5286
|
O && /* @__PURE__ */ d("style", { children: O }),
|
|
5287
|
+
k && /* @__PURE__ */ d("style", { children: k }),
|
|
4368
5288
|
w
|
|
4369
5289
|
]
|
|
4370
5290
|
})
|
|
4371
5291
|
})
|
|
4372
5292
|
})
|
|
4373
5293
|
})
|
|
4374
|
-
}) : /* @__PURE__ */ d(
|
|
5294
|
+
}) : /* @__PURE__ */ d(K.Provider, {
|
|
4375
5295
|
value: {
|
|
4376
|
-
tenant:
|
|
4377
|
-
apiUrl:
|
|
4378
|
-
locale:
|
|
4379
|
-
settings:
|
|
5296
|
+
tenant: l || "",
|
|
5297
|
+
apiUrl: u || "/api",
|
|
5298
|
+
locale: m || "",
|
|
5299
|
+
settings: _ ?? null
|
|
4380
5300
|
},
|
|
4381
|
-
children: /* @__PURE__ */ d(
|
|
4382
|
-
initialUser:
|
|
4383
|
-
children: /* @__PURE__ */ d(
|
|
4384
|
-
value:
|
|
4385
|
-
children: /* @__PURE__ */ d(
|
|
5301
|
+
children: /* @__PURE__ */ d(On, {
|
|
5302
|
+
initialUser: v,
|
|
5303
|
+
children: /* @__PURE__ */ d(q.Provider, {
|
|
5304
|
+
value: p ?? null,
|
|
5305
|
+
children: /* @__PURE__ */ d(Ce.Provider, {
|
|
4386
5306
|
value: T,
|
|
4387
5307
|
children: /* @__PURE__ */ f("div", {
|
|
4388
|
-
...
|
|
5308
|
+
...b,
|
|
4389
5309
|
className: "webim-page",
|
|
4390
5310
|
style: {
|
|
4391
|
-
...
|
|
4392
|
-
...
|
|
5311
|
+
...C,
|
|
5312
|
+
..._e(t, r),
|
|
4393
5313
|
...i
|
|
4394
5314
|
},
|
|
4395
5315
|
children: [
|
|
4396
|
-
|
|
4397
|
-
/* @__PURE__ */ d("style", { children:
|
|
5316
|
+
P,
|
|
5317
|
+
/* @__PURE__ */ d("style", { children: F }),
|
|
4398
5318
|
/* @__PURE__ */ d("style", { children: x }),
|
|
4399
5319
|
E && /* @__PURE__ */ d("style", { children: E }),
|
|
4400
|
-
D && /* @__PURE__ */ d("style", { children: D }),
|
|
4401
5320
|
O && /* @__PURE__ */ d("style", { children: O }),
|
|
5321
|
+
j && /* @__PURE__ */ d("style", { children: j }),
|
|
5322
|
+
j && /* @__PURE__ */ d("style", { children: j }),
|
|
5323
|
+
k && /* @__PURE__ */ d("style", { children: k }),
|
|
4402
5324
|
w
|
|
4403
5325
|
]
|
|
4404
5326
|
})
|
|
@@ -4409,25 +5331,26 @@ function Pn({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
4409
5331
|
}
|
|
4410
5332
|
//#endregion
|
|
4411
5333
|
//#region src/WebimContent.jsx
|
|
4412
|
-
function
|
|
4413
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ d(
|
|
5334
|
+
function ur({ bundle: e, mode: t = "auto", style: n }) {
|
|
5335
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ d(lr, {
|
|
4414
5336
|
blocks: e.blocks,
|
|
4415
5337
|
theme: e.theme,
|
|
4416
5338
|
components: e.components,
|
|
4417
5339
|
custom: e.custom,
|
|
5340
|
+
animations: e.animations,
|
|
4418
5341
|
tenant: e.tenant,
|
|
4419
5342
|
apiUrl: e.apiUrl,
|
|
4420
5343
|
datasets: e.datasets,
|
|
4421
5344
|
locale: e.locale,
|
|
4422
5345
|
direction: e.direction,
|
|
4423
5346
|
settings: e.settings,
|
|
4424
|
-
mode:
|
|
5347
|
+
mode: ye(t, e.scheme),
|
|
4425
5348
|
style: n
|
|
4426
5349
|
}) : null;
|
|
4427
5350
|
}
|
|
4428
5351
|
//#endregion
|
|
4429
5352
|
//#region src/bundle.js
|
|
4430
|
-
function
|
|
5353
|
+
function dr({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
4431
5354
|
let a = {
|
|
4432
5355
|
...t?.global ?? {},
|
|
4433
5356
|
...t?.tenant ?? {}
|
|
@@ -4437,9 +5360,10 @@ function In({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
4437
5360
|
title: e.title,
|
|
4438
5361
|
slug: e.slug,
|
|
4439
5362
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
4440
|
-
theme:
|
|
5363
|
+
theme: ve(o, a.builder_themes?.themes),
|
|
4441
5364
|
components: a.builder_components?.components ?? {},
|
|
4442
5365
|
custom: o.custom,
|
|
5366
|
+
animations: o.animations,
|
|
4443
5367
|
seo: o.seo,
|
|
4444
5368
|
direction: o.direction,
|
|
4445
5369
|
scheme: o.scheme,
|
|
@@ -4452,26 +5376,31 @@ function In({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
4452
5376
|
}
|
|
4453
5377
|
//#endregion
|
|
4454
5378
|
//#region src/fetchPage.js
|
|
4455
|
-
var
|
|
5379
|
+
var fr = async (e) => {
|
|
4456
5380
|
let t = await e.json().catch(() => null);
|
|
4457
5381
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
4458
5382
|
return t?.payload ?? t;
|
|
4459
5383
|
};
|
|
4460
|
-
async function
|
|
5384
|
+
async function pr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
4461
5385
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
4462
5386
|
if (!n) throw Error("fetchPage: slug is required");
|
|
4463
5387
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
4464
5388
|
...t ? { "x-tenant": t } : {},
|
|
4465
5389
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
4466
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
5390
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(fr), c(`${l}/settings/public`, { headers: u }).then(fr)]), p = dr({
|
|
4467
5391
|
page: d,
|
|
4468
5392
|
settings: f,
|
|
4469
5393
|
tenant: t,
|
|
4470
5394
|
apiUrl: l,
|
|
4471
5395
|
locale: r
|
|
4472
|
-
}), m = [...new Set(Object.values(p.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection :
|
|
5396
|
+
}), m = [...new Set(Object.values(p.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : [
|
|
5397
|
+
"TableBlock",
|
|
5398
|
+
"OrgChartBlock",
|
|
5399
|
+
"NavbarBlock",
|
|
5400
|
+
"CalendarBlock"
|
|
5401
|
+
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
4473
5402
|
if (m.length) {
|
|
4474
|
-
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(
|
|
5403
|
+
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(fr).then((e) => {
|
|
4475
5404
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
4476
5405
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
4477
5406
|
}).catch(() => [[t, []]])));
|
|
@@ -4485,40 +5414,40 @@ async function Rn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
4485
5414
|
}
|
|
4486
5415
|
//#endregion
|
|
4487
5416
|
//#region src/ssr.jsx
|
|
4488
|
-
var
|
|
5417
|
+
var mr = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
4489
5418
|
"&": "&",
|
|
4490
5419
|
"<": "<",
|
|
4491
5420
|
">": ">",
|
|
4492
5421
|
"\"": """
|
|
4493
5422
|
})[e]);
|
|
4494
|
-
function
|
|
4495
|
-
return e(/* @__PURE__ */ d(
|
|
5423
|
+
function hr(t, { mode: n = "auto", style: r } = {}) {
|
|
5424
|
+
return e(/* @__PURE__ */ d(ur, {
|
|
4496
5425
|
bundle: t,
|
|
4497
5426
|
mode: n,
|
|
4498
5427
|
style: r
|
|
4499
5428
|
}));
|
|
4500
5429
|
}
|
|
4501
|
-
function
|
|
5430
|
+
function gr(e, { mode: t = "auto", lang: n } = {}) {
|
|
4502
5431
|
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 = [
|
|
4503
5432
|
"<meta charset=\"utf-8\"/>",
|
|
4504
5433
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
4505
|
-
`<title>${
|
|
4506
|
-
r.description && `<meta name="description" content="${
|
|
4507
|
-
`<meta property="og:title" content="${
|
|
4508
|
-
r.image && `<meta property="og:image" content="${
|
|
5434
|
+
`<title>${mr(o)}</title>`,
|
|
5435
|
+
r.description && `<meta name="description" content="${mr(r.description)}"/>`,
|
|
5436
|
+
`<meta property="og:title" content="${mr(o)}"/>`,
|
|
5437
|
+
r.image && `<meta property="og:image" content="${mr(r.image)}"/>`,
|
|
4509
5438
|
r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
|
|
4510
5439
|
"<style>html,body{margin:0;height:100%}</style>"
|
|
4511
5440
|
].filter(Boolean).join("\n");
|
|
4512
5441
|
return `<!doctype html>
|
|
4513
|
-
<html lang="${
|
|
5442
|
+
<html lang="${mr(i)}"${a ? ` dir="${a}"` : ""}>
|
|
4514
5443
|
<head>
|
|
4515
5444
|
${c}
|
|
4516
5445
|
</head>
|
|
4517
5446
|
<body>
|
|
4518
|
-
${
|
|
5447
|
+
${hr(e, { mode: t })}
|
|
4519
5448
|
${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
4520
5449
|
</body>
|
|
4521
5450
|
</html>`;
|
|
4522
5451
|
}
|
|
4523
5452
|
//#endregion
|
|
4524
|
-
export {
|
|
5453
|
+
export { dr as assembleBundle, pr as fetchPage, hr as renderBundleHtml, gr as renderPageDocument };
|