webim-adapter 0.29.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/webim-adapter.js +1671 -740
- package/build/webim-embed.js +13 -11
- package/build/webim-ssr.js +1648 -719
- 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,160 @@ 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") ?? 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" ? (window.addEventListener("scroll", s, { passive: !0 }), n.push(() => window.removeEventListener("scroll", s))) : (e.addEventListener(t, s), n.push(() => e.removeEventListener(t, s)));
|
|
363
|
+
}
|
|
364
|
+
e.__webimEvents = n;
|
|
365
|
+
}
|
|
366
|
+
function te(e, t, n = []) {
|
|
278
367
|
t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
|
|
279
|
-
let r =
|
|
368
|
+
let r = R(t.classNames), i = R(e.getAttribute("data-wb-class"));
|
|
280
369
|
for (let t of i) r.includes(t) || e.classList.remove(t);
|
|
281
370
|
for (let t of r) e.classList.add(t);
|
|
282
371
|
r.length ? e.setAttribute("data-wb-class", r.join(" ")) : e.removeAttribute("data-wb-class");
|
|
@@ -284,19 +373,19 @@ function M(e, t, n = []) {
|
|
|
284
373
|
let a = [];
|
|
285
374
|
for (let n of t.attributes ?? []) {
|
|
286
375
|
let t = String(n?.name ?? "").trim();
|
|
287
|
-
|
|
376
|
+
L(t) && (e.setAttribute(t, n.value ?? ""), a.push(t));
|
|
288
377
|
}
|
|
289
378
|
return a;
|
|
290
379
|
}
|
|
291
|
-
var
|
|
292
|
-
function
|
|
293
|
-
let i = Object.entries(
|
|
380
|
+
var W = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
381
|
+
function ne(e, t, n, r = !1) {
|
|
382
|
+
let i = Object.entries(P(t)).map(([e, t]) => `${W(e)}: ${t} !important;`).join(" ");
|
|
294
383
|
return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
|
|
295
384
|
}
|
|
296
|
-
function
|
|
297
|
-
return Object.entries(
|
|
385
|
+
function re(e, t, n) {
|
|
386
|
+
return Object.entries(F).map(([r, i]) => ne(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
298
387
|
}
|
|
299
|
-
var
|
|
388
|
+
var ie = [
|
|
300
389
|
{
|
|
301
390
|
key: "tablet",
|
|
302
391
|
max: 991
|
|
@@ -309,17 +398,17 @@ var ee = [
|
|
|
309
398
|
key: "mobile",
|
|
310
399
|
max: 478
|
|
311
400
|
}
|
|
312
|
-
],
|
|
313
|
-
function
|
|
314
|
-
return
|
|
315
|
-
let i = t?.[n] ?
|
|
401
|
+
], ae = (e) => Object.entries(P(e)).map(([e, t]) => `${W(e)}: ${t} !important;`).join(" ");
|
|
402
|
+
function oe(e, t) {
|
|
403
|
+
return ie.map(({ key: n, max: r }) => {
|
|
404
|
+
let i = t?.[n] ? ae(t[n]) : "";
|
|
316
405
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
317
406
|
}).filter(Boolean).join("\n");
|
|
318
407
|
}
|
|
319
|
-
function
|
|
408
|
+
function se(e, t) {
|
|
320
409
|
let n = [], r = (e) => {
|
|
321
410
|
for (let [t, r] of Object.entries(e || {})) {
|
|
322
|
-
let e =
|
|
411
|
+
let e = oe(t, r.props);
|
|
323
412
|
e && n.push(e);
|
|
324
413
|
}
|
|
325
414
|
};
|
|
@@ -327,10 +416,10 @@ function re(e, t) {
|
|
|
327
416
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
328
417
|
return n.join("\n");
|
|
329
418
|
}
|
|
330
|
-
function
|
|
419
|
+
function ce(e, t) {
|
|
331
420
|
let n = [], r = (e) => {
|
|
332
421
|
for (let [t, r] of Object.entries(e || {})) {
|
|
333
|
-
let e =
|
|
422
|
+
let e = re(t, r.props);
|
|
334
423
|
e && n.push(e);
|
|
335
424
|
}
|
|
336
425
|
};
|
|
@@ -338,7 +427,7 @@ function ie(e, t) {
|
|
|
338
427
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
339
428
|
return n.join("\n");
|
|
340
429
|
}
|
|
341
|
-
var
|
|
430
|
+
var G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", le = {
|
|
342
431
|
light: {
|
|
343
432
|
background: "#f2f2f2",
|
|
344
433
|
surface: "#f2f2f2",
|
|
@@ -379,23 +468,23 @@ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
379
468
|
contrastText: "#052e2b"
|
|
380
469
|
}
|
|
381
470
|
}
|
|
382
|
-
},
|
|
471
|
+
}, ue = {
|
|
383
472
|
font: "system",
|
|
384
473
|
headingFont: "inherit",
|
|
385
|
-
light:
|
|
386
|
-
dark:
|
|
387
|
-
},
|
|
474
|
+
light: le.light,
|
|
475
|
+
dark: le.dark
|
|
476
|
+
}, de = {
|
|
388
477
|
system: {
|
|
389
478
|
label: "System",
|
|
390
|
-
value:
|
|
479
|
+
value: G
|
|
391
480
|
},
|
|
392
481
|
inter: {
|
|
393
482
|
label: "Inter",
|
|
394
|
-
value: `"Inter", ${
|
|
483
|
+
value: `"Inter", ${G}`
|
|
395
484
|
},
|
|
396
485
|
outfit: {
|
|
397
486
|
label: "Outfit",
|
|
398
|
-
value: `"Outfit", ${
|
|
487
|
+
value: `"Outfit", ${G}`
|
|
399
488
|
},
|
|
400
489
|
serif: {
|
|
401
490
|
label: "Serif",
|
|
@@ -405,7 +494,7 @@ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
405
494
|
label: "Mono",
|
|
406
495
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
407
496
|
}
|
|
408
|
-
},
|
|
497
|
+
}, 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
498
|
let n = Object.assign({}, e, ...t);
|
|
410
499
|
return n.primary = {
|
|
411
500
|
...e.primary,
|
|
@@ -421,20 +510,20 @@ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
421
510
|
}), {})
|
|
422
511
|
}, n;
|
|
423
512
|
};
|
|
424
|
-
function
|
|
513
|
+
function me(e) {
|
|
425
514
|
let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
|
|
426
515
|
return {
|
|
427
|
-
font: r ??
|
|
428
|
-
headingFont: i ??
|
|
429
|
-
light:
|
|
430
|
-
dark:
|
|
516
|
+
font: r ?? ue.font,
|
|
517
|
+
headingFont: i ?? ue.headingFont,
|
|
518
|
+
light: pe(le.light, a, t),
|
|
519
|
+
dark: pe(le.dark, n)
|
|
431
520
|
};
|
|
432
521
|
}
|
|
433
|
-
function
|
|
522
|
+
function he(e) {
|
|
434
523
|
return {
|
|
435
524
|
"--page-bg": e.background,
|
|
436
525
|
"--page-surface": e.surface ?? e.background,
|
|
437
|
-
"--page-border": e.border ??
|
|
526
|
+
"--page-border": e.border ?? le.light.border,
|
|
438
527
|
"--page-text": e.text,
|
|
439
528
|
"--page-accent": e.accent,
|
|
440
529
|
"--page-accent-text": e.accentText,
|
|
@@ -448,58 +537,58 @@ function B(e) {
|
|
|
448
537
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
449
538
|
};
|
|
450
539
|
}
|
|
451
|
-
function
|
|
452
|
-
let t =
|
|
540
|
+
function ge(e) {
|
|
541
|
+
let t = me(e);
|
|
453
542
|
return {
|
|
454
543
|
backgroundColor: "var(--page-bg)",
|
|
455
544
|
color: "var(--page-text)",
|
|
456
|
-
fontFamily:
|
|
457
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
545
|
+
fontFamily: fe(t.font, G),
|
|
546
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : fe(t.headingFont, "inherit")
|
|
458
547
|
};
|
|
459
548
|
}
|
|
460
|
-
function
|
|
461
|
-
let n =
|
|
549
|
+
function _e(e, t = "light") {
|
|
550
|
+
let n = me(e);
|
|
462
551
|
return {
|
|
463
|
-
...
|
|
464
|
-
...
|
|
552
|
+
...ge(e),
|
|
553
|
+
...he(n[t] ?? n.light)
|
|
465
554
|
};
|
|
466
555
|
}
|
|
467
|
-
function
|
|
556
|
+
function ve(e, t) {
|
|
468
557
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
469
558
|
}
|
|
470
|
-
function
|
|
559
|
+
function ye(e, t) {
|
|
471
560
|
return e === "light" || e === "dark" ? e : t === "light" || t === "dark" ? t : "auto";
|
|
472
561
|
}
|
|
473
562
|
//#endregion
|
|
474
563
|
//#region ../ui/src/components/builder/views.jsx
|
|
475
|
-
var
|
|
564
|
+
var K = n({
|
|
476
565
|
tenant: "",
|
|
477
566
|
apiUrl: "/api",
|
|
478
567
|
locale: "",
|
|
479
568
|
settings: null
|
|
480
|
-
}),
|
|
569
|
+
}), q = n(null), be = (e) => {
|
|
481
570
|
let t = Number(e?.__page);
|
|
482
571
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
483
572
|
if (typeof window > "u") return 1;
|
|
484
573
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
485
574
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
486
|
-
},
|
|
575
|
+
}, xe = () => {
|
|
487
576
|
if (typeof window > "u") return {};
|
|
488
577
|
let e = {};
|
|
489
578
|
return new URLSearchParams(window.location.search).forEach((t, n) => {
|
|
490
579
|
n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
|
|
491
580
|
}), e;
|
|
492
|
-
},
|
|
581
|
+
}, Se = (e) => {
|
|
493
582
|
let t = {
|
|
494
583
|
...e && typeof e == "object" && !Array.isArray(e) ? e : {},
|
|
495
|
-
...
|
|
584
|
+
...xe()
|
|
496
585
|
};
|
|
497
586
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
498
|
-
},
|
|
499
|
-
function
|
|
587
|
+
}, Ce = n(null), we = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
588
|
+
function Te(e, t) {
|
|
500
589
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
501
590
|
}
|
|
502
|
-
var
|
|
591
|
+
var Ee = (e) => {
|
|
503
592
|
let t = [];
|
|
504
593
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
505
594
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -509,36 +598,36 @@ var _e = (e) => {
|
|
|
509
598
|
}
|
|
510
599
|
return t;
|
|
511
600
|
};
|
|
512
|
-
function
|
|
601
|
+
function J(e) {
|
|
513
602
|
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
603
|
}
|
|
515
|
-
function
|
|
516
|
-
let n = t?.data ?? {}, r =
|
|
604
|
+
function De(e, t) {
|
|
605
|
+
let n = t?.data ?? {}, r = Ee(n);
|
|
517
606
|
if (!r.length) return e;
|
|
518
|
-
let i = RegExp(`:(${r.map(
|
|
607
|
+
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
608
|
return a(e);
|
|
520
609
|
}
|
|
521
|
-
var
|
|
610
|
+
var Oe = {
|
|
522
611
|
margin: 0,
|
|
523
612
|
fontWeight: 700,
|
|
524
613
|
lineHeight: 1.2,
|
|
525
614
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
526
|
-
},
|
|
615
|
+
}, ke = { margin: 0 }, Y = {
|
|
527
616
|
display: "inline-block",
|
|
528
617
|
textDecoration: "none",
|
|
529
618
|
cursor: "pointer",
|
|
530
619
|
backgroundColor: "var(--page-accent, #111827)",
|
|
531
620
|
color: "var(--page-accent-text, #ffffff)"
|
|
532
|
-
},
|
|
621
|
+
}, Ae = {
|
|
533
622
|
flexGrow: 1,
|
|
534
623
|
display: "flex",
|
|
535
624
|
flexDirection: "column",
|
|
536
625
|
position: "relative"
|
|
537
|
-
},
|
|
626
|
+
}, je = {
|
|
538
627
|
display: "flex",
|
|
539
628
|
flexDirection: "column"
|
|
540
629
|
};
|
|
541
|
-
function
|
|
630
|
+
function Me({ style: e }) {
|
|
542
631
|
let t = e?.backgroundVideo;
|
|
543
632
|
if (!t) return null;
|
|
544
633
|
let n = {
|
|
@@ -564,32 +653,32 @@ function Ce({ style: e }) {
|
|
|
564
653
|
background: r
|
|
565
654
|
} })] });
|
|
566
655
|
}
|
|
567
|
-
var
|
|
656
|
+
var Ne = (e, t) => e?.backgroundVideo ? {
|
|
568
657
|
position: "relative",
|
|
569
658
|
...t,
|
|
570
|
-
...
|
|
659
|
+
...P(e)
|
|
571
660
|
} : {
|
|
572
661
|
...t,
|
|
573
|
-
...
|
|
662
|
+
...P(e)
|
|
574
663
|
};
|
|
575
|
-
function
|
|
664
|
+
function Pe({ style: e, nodeRef: t, children: n }) {
|
|
576
665
|
return /* @__PURE__ */ f("div", {
|
|
577
666
|
ref: t,
|
|
578
667
|
style: {
|
|
579
|
-
...
|
|
580
|
-
...
|
|
668
|
+
...Ae,
|
|
669
|
+
...P(e)
|
|
581
670
|
},
|
|
582
|
-
children: [/* @__PURE__ */ d(
|
|
671
|
+
children: [/* @__PURE__ */ d(Me, { style: e }), n]
|
|
583
672
|
});
|
|
584
673
|
}
|
|
585
|
-
function
|
|
674
|
+
function Fe({ style: e, nodeRef: t, children: n }) {
|
|
586
675
|
return /* @__PURE__ */ f("section", {
|
|
587
676
|
ref: t,
|
|
588
|
-
style:
|
|
589
|
-
children: [/* @__PURE__ */ d(
|
|
677
|
+
style: Ne(e, je),
|
|
678
|
+
children: [/* @__PURE__ */ d(Me, { style: e }), n]
|
|
590
679
|
});
|
|
591
680
|
}
|
|
592
|
-
function
|
|
681
|
+
function Ie({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
593
682
|
let i = t ? {
|
|
594
683
|
position: "relative",
|
|
595
684
|
minHeight: 240
|
|
@@ -598,32 +687,32 @@ function De({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
598
687
|
ref: n,
|
|
599
688
|
style: i ? {
|
|
600
689
|
...i,
|
|
601
|
-
...
|
|
602
|
-
} :
|
|
603
|
-
children: [/* @__PURE__ */ d(
|
|
690
|
+
...Ne(e)
|
|
691
|
+
} : Ne(e),
|
|
692
|
+
children: [/* @__PURE__ */ d(Me, { style: e }), r]
|
|
604
693
|
});
|
|
605
694
|
}
|
|
606
|
-
function
|
|
695
|
+
function Le({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
607
696
|
return /* @__PURE__ */ d(n, {
|
|
608
697
|
ref: a,
|
|
609
698
|
style: {
|
|
610
|
-
...
|
|
611
|
-
...
|
|
699
|
+
...Oe,
|
|
700
|
+
...P(r)
|
|
612
701
|
},
|
|
613
|
-
children:
|
|
702
|
+
children: X(t, e, i)
|
|
614
703
|
});
|
|
615
704
|
}
|
|
616
|
-
var
|
|
617
|
-
fontFamily:
|
|
705
|
+
var Re = {
|
|
706
|
+
fontFamily: de.mono.value,
|
|
618
707
|
background: "rgba(148, 163, 184, 0.18)",
|
|
619
708
|
padding: "1px 5px",
|
|
620
709
|
borderRadius: 4,
|
|
621
710
|
fontSize: "0.9em"
|
|
622
711
|
};
|
|
623
|
-
function
|
|
712
|
+
function ze(e, t = [], n, r) {
|
|
624
713
|
let i = e;
|
|
625
714
|
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:
|
|
715
|
+
style: Re,
|
|
627
716
|
children: i
|
|
628
717
|
})), 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
718
|
href: n,
|
|
@@ -633,13 +722,13 @@ function Ae(e, t = [], n, r) {
|
|
|
633
722
|
children: i
|
|
634
723
|
})), i;
|
|
635
724
|
}
|
|
636
|
-
function
|
|
725
|
+
function X(e, n, r) {
|
|
637
726
|
return e?.length ? e.map((e, n) => {
|
|
638
727
|
if (e.slot) return /* @__PURE__ */ d(t, { children: r?.[e.slot] ?? null }, n);
|
|
639
|
-
if (e.parts) return /* @__PURE__ */ d(t, { children:
|
|
728
|
+
if (e.parts) return /* @__PURE__ */ d(t, { children: X(e.parts, "", r) }, n);
|
|
640
729
|
let i = e.text;
|
|
641
730
|
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:
|
|
731
|
+
style: Re,
|
|
643
732
|
children: i
|
|
644
733
|
})), 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
734
|
style: {
|
|
@@ -656,13 +745,13 @@ function K(e, n, r) {
|
|
|
656
745
|
})), /* @__PURE__ */ d(t, { children: i }, n);
|
|
657
746
|
}) : n;
|
|
658
747
|
}
|
|
659
|
-
function
|
|
748
|
+
function Be({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
660
749
|
return /* @__PURE__ */ d("span", {
|
|
661
|
-
style:
|
|
662
|
-
children: e?.length ?
|
|
750
|
+
style: P(a),
|
|
751
|
+
children: e?.length ? X(e, t) : ze(t, n, r, i)
|
|
663
752
|
});
|
|
664
753
|
}
|
|
665
|
-
var
|
|
754
|
+
var Ve = {
|
|
666
755
|
h1: 40,
|
|
667
756
|
h2: 32,
|
|
668
757
|
h3: 26,
|
|
@@ -670,7 +759,7 @@ var Me = {
|
|
|
670
759
|
h5: 19,
|
|
671
760
|
h6: 16
|
|
672
761
|
};
|
|
673
|
-
function
|
|
762
|
+
function He({ align: e = "center", width: t, wrap: n } = {}) {
|
|
674
763
|
let r = t ? `${t}%` : void 0;
|
|
675
764
|
if (e === "full") return { width: "100%" };
|
|
676
765
|
let i = e === "left" || e === "right";
|
|
@@ -704,8 +793,8 @@ function Ne({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
704
793
|
marginRight: "auto"
|
|
705
794
|
};
|
|
706
795
|
}
|
|
707
|
-
function
|
|
708
|
-
let r = n ?? ((e, n) =>
|
|
796
|
+
function Ue(e = [], t, n) {
|
|
797
|
+
let r = n ?? ((e, n) => X(e, n, t));
|
|
709
798
|
return e.map((t, n) => {
|
|
710
799
|
let i = {
|
|
711
800
|
marginTop: 0,
|
|
@@ -727,7 +816,7 @@ function Pe(e = [], t, n) {
|
|
|
727
816
|
marginLeft: 0,
|
|
728
817
|
marginRight: 0,
|
|
729
818
|
...i,
|
|
730
|
-
...
|
|
819
|
+
...He(t)
|
|
731
820
|
},
|
|
732
821
|
children: [t.href ? /* @__PURE__ */ d("a", {
|
|
733
822
|
href: t.href,
|
|
@@ -746,16 +835,16 @@ function Pe(e = [], t, n) {
|
|
|
746
835
|
})]
|
|
747
836
|
}, n);
|
|
748
837
|
}
|
|
749
|
-
if (t.type === "video") return
|
|
838
|
+
if (t.type === "video") return et(t.url) ? /* @__PURE__ */ d("div", {
|
|
750
839
|
style: {
|
|
751
840
|
...i,
|
|
752
|
-
...
|
|
841
|
+
...He({
|
|
753
842
|
align: t.align,
|
|
754
843
|
wrap: t.wrap,
|
|
755
844
|
width: t.width ?? 100
|
|
756
845
|
})
|
|
757
846
|
},
|
|
758
|
-
children: /* @__PURE__ */ d(
|
|
847
|
+
children: /* @__PURE__ */ d(tt, {
|
|
759
848
|
url: t.url,
|
|
760
849
|
autoplay: t.autoplay,
|
|
761
850
|
muted: t.muted,
|
|
@@ -817,17 +906,17 @@ function Pe(e = [], t, n) {
|
|
|
817
906
|
}
|
|
818
907
|
if (t.type === "quote") return /* @__PURE__ */ d("blockquote", {
|
|
819
908
|
style: {
|
|
820
|
-
...
|
|
909
|
+
...Ge,
|
|
821
910
|
...i
|
|
822
911
|
},
|
|
823
912
|
children: r(t.parts, t.text)
|
|
824
913
|
}, n);
|
|
825
|
-
if (
|
|
914
|
+
if (Ve[t.type]) {
|
|
826
915
|
let e = t.type;
|
|
827
916
|
return /* @__PURE__ */ d(e, {
|
|
828
917
|
style: {
|
|
829
|
-
...
|
|
830
|
-
fontSize:
|
|
918
|
+
...Oe,
|
|
919
|
+
fontSize: Ve[t.type],
|
|
831
920
|
...i
|
|
832
921
|
},
|
|
833
922
|
children: r(t.parts, t.text)
|
|
@@ -835,95 +924,95 @@ function Pe(e = [], t, n) {
|
|
|
835
924
|
}
|
|
836
925
|
return /* @__PURE__ */ d("p", {
|
|
837
926
|
style: {
|
|
838
|
-
...
|
|
927
|
+
...ke,
|
|
839
928
|
...i
|
|
840
929
|
},
|
|
841
930
|
children: r(t.parts, t.text)
|
|
842
931
|
}, n);
|
|
843
932
|
});
|
|
844
933
|
}
|
|
845
|
-
function
|
|
934
|
+
function We({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
846
935
|
return /* @__PURE__ */ d("div", {
|
|
847
936
|
ref: r,
|
|
848
937
|
style: {
|
|
849
938
|
display: "flow-root",
|
|
850
|
-
...
|
|
939
|
+
...P(t)
|
|
851
940
|
},
|
|
852
|
-
children:
|
|
941
|
+
children: Ue(e, n)
|
|
853
942
|
});
|
|
854
943
|
}
|
|
855
|
-
var
|
|
944
|
+
var Ge = {
|
|
856
945
|
margin: 0,
|
|
857
946
|
padding: "8px 0 8px 20px",
|
|
858
947
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
859
948
|
};
|
|
860
|
-
function
|
|
949
|
+
function Ke({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
861
950
|
return /* @__PURE__ */ d("blockquote", {
|
|
862
951
|
ref: i,
|
|
863
952
|
style: {
|
|
864
|
-
...
|
|
865
|
-
...
|
|
953
|
+
...Ge,
|
|
954
|
+
...P(n)
|
|
866
955
|
},
|
|
867
|
-
children:
|
|
956
|
+
children: X(t, e, r)
|
|
868
957
|
});
|
|
869
958
|
}
|
|
870
|
-
function
|
|
959
|
+
function qe({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
871
960
|
return /* @__PURE__ */ d(e ? "ol" : "ul", {
|
|
872
961
|
ref: r,
|
|
873
962
|
style: {
|
|
874
963
|
margin: 0,
|
|
875
964
|
paddingLeft: 24,
|
|
876
|
-
...
|
|
965
|
+
...P(n)
|
|
877
966
|
},
|
|
878
967
|
children: t.map((e, t) => /* @__PURE__ */ d("li", {
|
|
879
968
|
style: { marginBottom: 4 },
|
|
880
|
-
children:
|
|
969
|
+
children: X(e.parts, e.text)
|
|
881
970
|
}, t))
|
|
882
971
|
});
|
|
883
972
|
}
|
|
884
|
-
function
|
|
973
|
+
function Je({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
885
974
|
return /* @__PURE__ */ d("p", {
|
|
886
975
|
ref: i,
|
|
887
976
|
style: {
|
|
888
|
-
...
|
|
889
|
-
...
|
|
977
|
+
...ke,
|
|
978
|
+
...P(n)
|
|
890
979
|
},
|
|
891
|
-
children:
|
|
980
|
+
children: X(t, e, r)
|
|
892
981
|
});
|
|
893
982
|
}
|
|
894
|
-
var
|
|
983
|
+
var Ye = {
|
|
895
984
|
color: "var(--page-accent, inherit)",
|
|
896
985
|
textDecoration: "underline",
|
|
897
986
|
textUnderlineOffset: 3,
|
|
898
987
|
cursor: "pointer"
|
|
899
988
|
};
|
|
900
|
-
function
|
|
989
|
+
function Xe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
901
990
|
return /* @__PURE__ */ d("a", {
|
|
902
991
|
ref: o,
|
|
903
992
|
href: n || "#",
|
|
904
993
|
target: r || void 0,
|
|
905
994
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
906
995
|
style: {
|
|
907
|
-
...
|
|
908
|
-
...
|
|
996
|
+
...Ye,
|
|
997
|
+
...P(i)
|
|
909
998
|
},
|
|
910
|
-
children:
|
|
999
|
+
children: X(t, e, a)
|
|
911
1000
|
});
|
|
912
1001
|
}
|
|
913
|
-
function
|
|
1002
|
+
function Ze({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
914
1003
|
return /* @__PURE__ */ d("a", {
|
|
915
1004
|
ref: o,
|
|
916
1005
|
href: n || "#",
|
|
917
1006
|
target: r || void 0,
|
|
918
1007
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
919
1008
|
style: {
|
|
920
|
-
...
|
|
921
|
-
...
|
|
1009
|
+
...Y,
|
|
1010
|
+
...P(i)
|
|
922
1011
|
},
|
|
923
|
-
children:
|
|
1012
|
+
children: X(t, e, a)
|
|
924
1013
|
});
|
|
925
1014
|
}
|
|
926
|
-
function
|
|
1015
|
+
function Qe({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
927
1016
|
return e ? /* @__PURE__ */ d("img", {
|
|
928
1017
|
ref: r,
|
|
929
1018
|
src: e,
|
|
@@ -931,11 +1020,11 @@ function Ue({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
931
1020
|
style: {
|
|
932
1021
|
display: "block",
|
|
933
1022
|
maxWidth: "100%",
|
|
934
|
-
...
|
|
1023
|
+
...P(n)
|
|
935
1024
|
}
|
|
936
1025
|
}) : null;
|
|
937
1026
|
}
|
|
938
|
-
function
|
|
1027
|
+
function $e({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
939
1028
|
return e ? /* @__PURE__ */ d("video", {
|
|
940
1029
|
ref: s,
|
|
941
1030
|
src: e,
|
|
@@ -949,13 +1038,13 @@ function We({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
949
1038
|
display: "block",
|
|
950
1039
|
width: "100%",
|
|
951
1040
|
maxWidth: "100%",
|
|
952
|
-
...
|
|
1041
|
+
...P(o)
|
|
953
1042
|
}
|
|
954
1043
|
}) : null;
|
|
955
1044
|
}
|
|
956
|
-
var
|
|
957
|
-
function
|
|
958
|
-
let c =
|
|
1045
|
+
var et = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
1046
|
+
function tt({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
1047
|
+
let c = et(e);
|
|
959
1048
|
if (!c) return null;
|
|
960
1049
|
let l = new URLSearchParams({ rel: "0" });
|
|
961
1050
|
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 +1053,7 @@ function Ke({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
964
1053
|
position: "relative",
|
|
965
1054
|
width: "100%",
|
|
966
1055
|
paddingTop: "56.25%",
|
|
967
|
-
...
|
|
1056
|
+
...P(o)
|
|
968
1057
|
},
|
|
969
1058
|
children: /* @__PURE__ */ d("iframe", {
|
|
970
1059
|
src: `https://www.youtube-nocookie.com/embed/${c}?${l}`,
|
|
@@ -981,7 +1070,7 @@ function Ke({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
981
1070
|
})
|
|
982
1071
|
});
|
|
983
1072
|
}
|
|
984
|
-
function
|
|
1073
|
+
function nt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
985
1074
|
return e ? /* @__PURE__ */ d("iframe", {
|
|
986
1075
|
ref: i,
|
|
987
1076
|
src: e,
|
|
@@ -993,11 +1082,11 @@ function qe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
993
1082
|
width: "100%",
|
|
994
1083
|
height: 300,
|
|
995
1084
|
border: 0,
|
|
996
|
-
...
|
|
1085
|
+
...P(r)
|
|
997
1086
|
}
|
|
998
1087
|
}) : null;
|
|
999
1088
|
}
|
|
1000
|
-
function
|
|
1089
|
+
function rt({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
1001
1090
|
let [i, o] = l(null);
|
|
1002
1091
|
return a(() => {
|
|
1003
1092
|
i && (i.innerHTML = e || "", t && i.querySelectorAll("script").forEach((e) => {
|
|
@@ -1013,10 +1102,10 @@ function Je({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
|
1013
1102
|
ref: (e) => {
|
|
1014
1103
|
o(e), r && r(e);
|
|
1015
1104
|
},
|
|
1016
|
-
style:
|
|
1105
|
+
style: P(n)
|
|
1017
1106
|
});
|
|
1018
1107
|
}
|
|
1019
|
-
function
|
|
1108
|
+
function it({ height: e, nodeRef: t }) {
|
|
1020
1109
|
return /* @__PURE__ */ d("div", {
|
|
1021
1110
|
ref: t,
|
|
1022
1111
|
style: {
|
|
@@ -1026,18 +1115,18 @@ function Ye({ height: e, nodeRef: t }) {
|
|
|
1026
1115
|
}
|
|
1027
1116
|
});
|
|
1028
1117
|
}
|
|
1029
|
-
function
|
|
1118
|
+
function at({ style: e, nodeRef: t }) {
|
|
1030
1119
|
return /* @__PURE__ */ d("div", {
|
|
1031
1120
|
ref: t,
|
|
1032
1121
|
style: {
|
|
1033
1122
|
height: 1,
|
|
1034
1123
|
alignSelf: "stretch",
|
|
1035
1124
|
flexShrink: 0,
|
|
1036
|
-
...
|
|
1125
|
+
...P(e)
|
|
1037
1126
|
}
|
|
1038
1127
|
});
|
|
1039
1128
|
}
|
|
1040
|
-
var
|
|
1129
|
+
var ot = {
|
|
1041
1130
|
position: "absolute",
|
|
1042
1131
|
top: "50%",
|
|
1043
1132
|
transform: "translateY(-50%)",
|
|
@@ -1054,7 +1143,7 @@ var Ze = {
|
|
|
1054
1143
|
alignItems: "center",
|
|
1055
1144
|
justifyContent: "center",
|
|
1056
1145
|
padding: 0
|
|
1057
|
-
},
|
|
1146
|
+
}, st = {
|
|
1058
1147
|
bottom: {
|
|
1059
1148
|
inset: "auto 0 0 0",
|
|
1060
1149
|
padding: "40px 24px 20px",
|
|
@@ -1073,8 +1162,8 @@ var Ze = {
|
|
|
1073
1162
|
padding: 24,
|
|
1074
1163
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1075
1164
|
}
|
|
1076
|
-
},
|
|
1077
|
-
function
|
|
1165
|
+
}, ct = 48;
|
|
1166
|
+
function lt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
|
|
1078
1167
|
let [p, m] = l(0), [h, g] = l(!1), [_, v] = l(null), y = e ? Math.min(p, e - 1) : 0;
|
|
1079
1168
|
if (a(() => {
|
|
1080
1169
|
if (!n || h || _ || e < 2) return;
|
|
@@ -1090,7 +1179,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1090
1179
|
let b = (t) => m((t + e) % e), x = () => {
|
|
1091
1180
|
if (!_) return;
|
|
1092
1181
|
let { dx: e } = _;
|
|
1093
|
-
v(null), e < -48 ? b(y + 1) : e >
|
|
1182
|
+
v(null), e < -48 ? b(y + 1) : e > ct && b(y - 1);
|
|
1094
1183
|
};
|
|
1095
1184
|
return /* @__PURE__ */ f("div", {
|
|
1096
1185
|
ref: c,
|
|
@@ -1115,7 +1204,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1115
1204
|
touchAction: "pan-y",
|
|
1116
1205
|
userSelect: _ ? "none" : void 0,
|
|
1117
1206
|
cursor: _ ? "grabbing" : void 0,
|
|
1118
|
-
...
|
|
1207
|
+
...P(s)
|
|
1119
1208
|
},
|
|
1120
1209
|
children: [/* @__PURE__ */ d("div", {
|
|
1121
1210
|
style: {
|
|
@@ -1138,7 +1227,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1138
1227
|
type: "button",
|
|
1139
1228
|
"aria-label": "Previous slide",
|
|
1140
1229
|
style: {
|
|
1141
|
-
...
|
|
1230
|
+
...ot,
|
|
1142
1231
|
left: 12
|
|
1143
1232
|
},
|
|
1144
1233
|
onClick: () => b(y - 1),
|
|
@@ -1148,7 +1237,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1148
1237
|
type: "button",
|
|
1149
1238
|
"aria-label": "Next slide",
|
|
1150
1239
|
style: {
|
|
1151
|
-
...
|
|
1240
|
+
...ot,
|
|
1152
1241
|
right: 12
|
|
1153
1242
|
},
|
|
1154
1243
|
onClick: () => b(y + 1),
|
|
@@ -1182,7 +1271,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1182
1271
|
] })]
|
|
1183
1272
|
});
|
|
1184
1273
|
}
|
|
1185
|
-
var
|
|
1274
|
+
var ut = (e, t) => ({
|
|
1186
1275
|
position: "absolute",
|
|
1187
1276
|
inset: 0,
|
|
1188
1277
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1190,18 +1279,18 @@ var tt = (e, t) => ({
|
|
|
1190
1279
|
backgroundSize: "cover",
|
|
1191
1280
|
backgroundPosition: "center"
|
|
1192
1281
|
});
|
|
1193
|
-
function
|
|
1194
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1282
|
+
function dt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1283
|
+
return e.length ? /* @__PURE__ */ d(lt, {
|
|
1195
1284
|
...r,
|
|
1196
1285
|
count: e.length,
|
|
1197
1286
|
renderSlide: (r) => {
|
|
1198
1287
|
let i = e[r];
|
|
1199
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1288
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: ut(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
|
|
1200
1289
|
style: {
|
|
1201
1290
|
position: "absolute",
|
|
1202
1291
|
color: "#fff",
|
|
1203
1292
|
textAlign: n,
|
|
1204
|
-
...
|
|
1293
|
+
...st[t] ?? st.bottom
|
|
1205
1294
|
},
|
|
1206
1295
|
children: [i.title && /* @__PURE__ */ d("div", {
|
|
1207
1296
|
style: {
|
|
@@ -1221,13 +1310,13 @@ function nt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1221
1310
|
}
|
|
1222
1311
|
}) : null;
|
|
1223
1312
|
}
|
|
1224
|
-
function
|
|
1225
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1313
|
+
function ft({ slides: e = [], linked: t, ...n }) {
|
|
1314
|
+
return e.length ? /* @__PURE__ */ d(lt, {
|
|
1226
1315
|
...n,
|
|
1227
1316
|
count: e.length,
|
|
1228
1317
|
renderSlide: (n) => {
|
|
1229
1318
|
let r = e[n];
|
|
1230
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1319
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: ut(r.image, r.color) }), /* @__PURE__ */ d("div", {
|
|
1231
1320
|
style: {
|
|
1232
1321
|
position: "absolute",
|
|
1233
1322
|
inset: 0,
|
|
@@ -1239,7 +1328,7 @@ function rt({ slides: e = [], linked: t, ...n }) {
|
|
|
1239
1328
|
}
|
|
1240
1329
|
}) : null;
|
|
1241
1330
|
}
|
|
1242
|
-
function
|
|
1331
|
+
function pt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lightbox: i = !0, style: o, nodeRef: s, inert: c }) {
|
|
1243
1332
|
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
1333
|
a(() => {
|
|
1245
1334
|
if (!v) return;
|
|
@@ -1264,7 +1353,7 @@ function it({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1264
1353
|
columnCount: Math.min(Math.max(Number(t) || 3, 1), 8),
|
|
1265
1354
|
columnGap: m,
|
|
1266
1355
|
width: "100%",
|
|
1267
|
-
...
|
|
1356
|
+
...P(o)
|
|
1268
1357
|
},
|
|
1269
1358
|
children: [
|
|
1270
1359
|
p.map((e, t) => {
|
|
@@ -1438,45 +1527,136 @@ function it({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1438
1527
|
]
|
|
1439
1528
|
});
|
|
1440
1529
|
}
|
|
1441
|
-
var
|
|
1530
|
+
var mt = {
|
|
1442
1531
|
color: "inherit",
|
|
1443
1532
|
textDecoration: "none",
|
|
1444
1533
|
fontSize: 14,
|
|
1445
1534
|
opacity: .85
|
|
1446
|
-
},
|
|
1535
|
+
}, ht = {
|
|
1447
1536
|
background: "var(--page-surface, #f2f2f2)",
|
|
1448
1537
|
color: "var(--page-text, #111827)",
|
|
1449
1538
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
1450
1539
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1451
1540
|
zIndex: 60
|
|
1452
1541
|
};
|
|
1453
|
-
function
|
|
1454
|
-
let
|
|
1542
|
+
function gt(e, t = {}, n = "dropdown") {
|
|
1543
|
+
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) => {
|
|
1544
|
+
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
1545
|
+
return {
|
|
1546
|
+
key: e.id,
|
|
1547
|
+
parent: (r && typeof r == "object" ? r.id : r) || null,
|
|
1548
|
+
label: a(n[t.labelField || "name"]) || a(n.name) || "Untitled",
|
|
1549
|
+
href: t.hrefField ? a(n[t.hrefField]) : "",
|
|
1550
|
+
image: t.imageField && i(n[t.imageField]) || "",
|
|
1551
|
+
desc: t.descField ? a(n[t.descField]) : ""
|
|
1552
|
+
};
|
|
1553
|
+
}), s = new Map(o.map((e) => [e.key, e])), c = (e) => {
|
|
1554
|
+
let t = /* @__PURE__ */ new Set(), n = e;
|
|
1555
|
+
for (; n.parent && s.has(n.parent) && !t.has(n.key);) t.add(n.key), n = s.get(n.parent);
|
|
1556
|
+
return n;
|
|
1557
|
+
}, l = [], u = /* @__PURE__ */ new Map();
|
|
1558
|
+
for (let e of o) {
|
|
1559
|
+
if (c(e) !== e) continue;
|
|
1560
|
+
let t = {
|
|
1561
|
+
key: e.key,
|
|
1562
|
+
label: e.label,
|
|
1563
|
+
href: e.href,
|
|
1564
|
+
image: e.image,
|
|
1565
|
+
children: []
|
|
1566
|
+
};
|
|
1567
|
+
u.set(e.key, t), l.push(t);
|
|
1568
|
+
}
|
|
1569
|
+
for (let e of o) {
|
|
1570
|
+
let t = c(e);
|
|
1571
|
+
t !== e && u.get(t.key)?.children.push({
|
|
1572
|
+
key: e.key,
|
|
1573
|
+
label: e.label,
|
|
1574
|
+
href: e.href,
|
|
1575
|
+
image: e.image,
|
|
1576
|
+
desc: e.desc
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1579
|
+
return l.map((e) => ({
|
|
1580
|
+
...e,
|
|
1581
|
+
type: e.children.length ? n : "link"
|
|
1582
|
+
}));
|
|
1583
|
+
}
|
|
1584
|
+
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" }) {
|
|
1585
|
+
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
1586
|
a(() => {
|
|
1456
|
-
if (!
|
|
1457
|
-
let e =
|
|
1458
|
-
return
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1587
|
+
if (!g || N) return;
|
|
1588
|
+
let e = !0;
|
|
1589
|
+
return fetch(`${M}/dynamic/${encodeURIComponent(g)}`, { headers: j ? { "x-tenant": j } : {} }).then((e) => e.json()).then((t) => {
|
|
1590
|
+
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
1591
|
+
e && I(n);
|
|
1592
|
+
}).catch(() => e && I([])), () => {
|
|
1593
|
+
e = !1;
|
|
1594
|
+
};
|
|
1595
|
+
}, [
|
|
1596
|
+
g,
|
|
1597
|
+
j,
|
|
1598
|
+
M,
|
|
1599
|
+
N
|
|
1600
|
+
]), a(() => {
|
|
1601
|
+
if (!C) return;
|
|
1602
|
+
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
1603
|
+
return e.observe(C), () => e.disconnect();
|
|
1604
|
+
}, [C, h]);
|
|
1605
|
+
let L = g ? gt(N ?? F ?? [], {
|
|
1606
|
+
labelField: _,
|
|
1607
|
+
hrefField: v,
|
|
1608
|
+
imageField: y,
|
|
1609
|
+
descField: b,
|
|
1610
|
+
parentField: x
|
|
1611
|
+
}, S) : s, R = m === "hamburger" || m === "auto" && T, z = (e, t, n = !1) => {
|
|
1612
|
+
let r = e.image ? /* @__PURE__ */ d("img", {
|
|
1613
|
+
src: e.image,
|
|
1614
|
+
alt: "",
|
|
1615
|
+
style: n ? {
|
|
1616
|
+
width: "100%",
|
|
1617
|
+
aspectRatio: "16 / 9",
|
|
1618
|
+
objectFit: "cover",
|
|
1619
|
+
borderRadius: 6,
|
|
1469
1620
|
display: "block",
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1621
|
+
marginBottom: 8
|
|
1622
|
+
} : {
|
|
1623
|
+
width: 22,
|
|
1624
|
+
height: 22,
|
|
1625
|
+
objectFit: "cover",
|
|
1626
|
+
borderRadius: 4,
|
|
1627
|
+
display: "block",
|
|
1628
|
+
flexShrink: 0
|
|
1629
|
+
}
|
|
1630
|
+
}) : null;
|
|
1631
|
+
return /* @__PURE__ */ f("a", {
|
|
1632
|
+
href: e.href || "#",
|
|
1633
|
+
style: {
|
|
1634
|
+
...mt,
|
|
1635
|
+
display: n ? "block" : "flex",
|
|
1636
|
+
alignItems: n ? void 0 : "center",
|
|
1637
|
+
gap: n ? void 0 : 10,
|
|
1638
|
+
...t
|
|
1473
1639
|
},
|
|
1474
|
-
children:
|
|
1475
|
-
|
|
1476
|
-
|
|
1640
|
+
children: [r, /* @__PURE__ */ f("span", {
|
|
1641
|
+
style: {
|
|
1642
|
+
display: "block",
|
|
1643
|
+
minWidth: 0
|
|
1644
|
+
},
|
|
1645
|
+
children: [e.label, e.desc && /* @__PURE__ */ d("span", {
|
|
1646
|
+
style: {
|
|
1647
|
+
display: "block",
|
|
1648
|
+
fontSize: 12,
|
|
1649
|
+
opacity: .6,
|
|
1650
|
+
marginTop: 2
|
|
1651
|
+
},
|
|
1652
|
+
children: e.desc
|
|
1653
|
+
})]
|
|
1654
|
+
})]
|
|
1655
|
+
}, e.key);
|
|
1656
|
+
};
|
|
1477
1657
|
return /* @__PURE__ */ f("nav", {
|
|
1478
1658
|
ref: (e) => {
|
|
1479
|
-
|
|
1659
|
+
w(e), p && p(e);
|
|
1480
1660
|
},
|
|
1481
1661
|
style: {
|
|
1482
1662
|
display: "flex",
|
|
@@ -1486,7 +1666,7 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1486
1666
|
padding: "14px 24px",
|
|
1487
1667
|
width: "100%",
|
|
1488
1668
|
position: "relative",
|
|
1489
|
-
...
|
|
1669
|
+
...P(c)
|
|
1490
1670
|
},
|
|
1491
1671
|
children: [
|
|
1492
1672
|
(n || e) && (() => {
|
|
@@ -1504,7 +1684,7 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1504
1684
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
1505
1685
|
},
|
|
1506
1686
|
children: e
|
|
1507
|
-
})] }),
|
|
1687
|
+
})] }), i = {
|
|
1508
1688
|
display: "flex",
|
|
1509
1689
|
alignItems: "center",
|
|
1510
1690
|
gap: 10,
|
|
@@ -1513,20 +1693,20 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1513
1693
|
};
|
|
1514
1694
|
return r ? /* @__PURE__ */ d("a", {
|
|
1515
1695
|
href: r,
|
|
1516
|
-
target:
|
|
1517
|
-
rel:
|
|
1518
|
-
style:
|
|
1696
|
+
target: o || void 0,
|
|
1697
|
+
rel: o === "_blank" ? "noopener noreferrer" : void 0,
|
|
1698
|
+
style: i,
|
|
1519
1699
|
children: t
|
|
1520
1700
|
}) : /* @__PURE__ */ d("div", {
|
|
1521
|
-
style:
|
|
1701
|
+
style: i,
|
|
1522
1702
|
children: t
|
|
1523
1703
|
});
|
|
1524
1704
|
})(),
|
|
1525
1705
|
/* @__PURE__ */ d("div", { style: { flexGrow: 1 } }),
|
|
1526
|
-
|
|
1706
|
+
R ? /* @__PURE__ */ d("button", {
|
|
1527
1707
|
type: "button",
|
|
1528
|
-
"aria-label":
|
|
1529
|
-
onClick: () =>
|
|
1708
|
+
"aria-label": D ? "Close menu" : "Open menu",
|
|
1709
|
+
onClick: () => O(!D),
|
|
1530
1710
|
style: {
|
|
1531
1711
|
background: "transparent",
|
|
1532
1712
|
border: 0,
|
|
@@ -1536,7 +1716,7 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1536
1716
|
lineHeight: 1,
|
|
1537
1717
|
padding: 4
|
|
1538
1718
|
},
|
|
1539
|
-
children:
|
|
1719
|
+
children: D ? "✕" : "☰"
|
|
1540
1720
|
}) : /* @__PURE__ */ d("div", {
|
|
1541
1721
|
style: {
|
|
1542
1722
|
display: "flex",
|
|
@@ -1544,11 +1724,11 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1544
1724
|
alignItems: "center",
|
|
1545
1725
|
flexWrap: "wrap"
|
|
1546
1726
|
},
|
|
1547
|
-
children:
|
|
1727
|
+
children: L.map((e) => {
|
|
1548
1728
|
let t = e.children ?? [];
|
|
1549
1729
|
if (!t.length) return /* @__PURE__ */ d("a", {
|
|
1550
1730
|
href: e.href || "#",
|
|
1551
|
-
style:
|
|
1731
|
+
style: mt,
|
|
1552
1732
|
children: e.label
|
|
1553
1733
|
}, e.key);
|
|
1554
1734
|
let n = e.type === "mega";
|
|
@@ -1557,12 +1737,12 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1557
1737
|
position: n ? "static" : "relative",
|
|
1558
1738
|
display: "inline-flex"
|
|
1559
1739
|
},
|
|
1560
|
-
onMouseEnter: () =>
|
|
1561
|
-
onMouseLeave: () =>
|
|
1740
|
+
onMouseEnter: () => A(e.key),
|
|
1741
|
+
onMouseLeave: () => A(null),
|
|
1562
1742
|
children: [/* @__PURE__ */ f("a", {
|
|
1563
1743
|
href: e.href || "#",
|
|
1564
1744
|
style: {
|
|
1565
|
-
...
|
|
1745
|
+
...mt,
|
|
1566
1746
|
cursor: "pointer"
|
|
1567
1747
|
},
|
|
1568
1748
|
children: [
|
|
@@ -1576,9 +1756,9 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1576
1756
|
children: "▼"
|
|
1577
1757
|
})
|
|
1578
1758
|
]
|
|
1579
|
-
}),
|
|
1759
|
+
}), k === e.key && (n ? /* @__PURE__ */ d("div", {
|
|
1580
1760
|
style: {
|
|
1581
|
-
...
|
|
1761
|
+
...ht,
|
|
1582
1762
|
position: "absolute",
|
|
1583
1763
|
left: 0,
|
|
1584
1764
|
right: 0,
|
|
@@ -1588,13 +1768,13 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1588
1768
|
gridTemplateColumns: "repeat(auto-fit, minmax(170px, 1fr))",
|
|
1589
1769
|
gap: 16
|
|
1590
1770
|
},
|
|
1591
|
-
children: t.map((e) =>
|
|
1592
|
-
padding:
|
|
1593
|
-
borderRadius:
|
|
1594
|
-
}))
|
|
1771
|
+
children: t.map((e) => z(e, {
|
|
1772
|
+
padding: 8,
|
|
1773
|
+
borderRadius: 8
|
|
1774
|
+
}, !0))
|
|
1595
1775
|
}) : /* @__PURE__ */ d("div", {
|
|
1596
1776
|
style: {
|
|
1597
|
-
...
|
|
1777
|
+
...ht,
|
|
1598
1778
|
position: "absolute",
|
|
1599
1779
|
top: "100%",
|
|
1600
1780
|
left: 0,
|
|
@@ -1604,7 +1784,7 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1604
1784
|
display: "flex",
|
|
1605
1785
|
flexDirection: "column"
|
|
1606
1786
|
},
|
|
1607
|
-
children: t.map((e) =>
|
|
1787
|
+
children: t.map((e) => z(e, {
|
|
1608
1788
|
padding: "8px 12px",
|
|
1609
1789
|
borderRadius: 6
|
|
1610
1790
|
}))
|
|
@@ -1612,7 +1792,7 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1612
1792
|
}, e.key);
|
|
1613
1793
|
})
|
|
1614
1794
|
}),
|
|
1615
|
-
|
|
1795
|
+
R && D && /* @__PURE__ */ d("div", {
|
|
1616
1796
|
style: {
|
|
1617
1797
|
flexBasis: "100%",
|
|
1618
1798
|
width: "100%",
|
|
@@ -1620,27 +1800,27 @@ function st({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1620
1800
|
flexDirection: "column",
|
|
1621
1801
|
paddingTop: 10
|
|
1622
1802
|
},
|
|
1623
|
-
children:
|
|
1803
|
+
children: L.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
|
|
1624
1804
|
href: e.href || "#",
|
|
1625
1805
|
style: {
|
|
1626
|
-
...
|
|
1806
|
+
...mt,
|
|
1627
1807
|
padding: "10px 4px",
|
|
1628
1808
|
fontWeight: (e.children ?? []).length ? 600 : 400,
|
|
1629
1809
|
opacity: 1
|
|
1630
1810
|
},
|
|
1631
1811
|
children: e.label
|
|
1632
|
-
}), (e.children ?? []).map((e) =>
|
|
1812
|
+
}), (e.children ?? []).map((e) => z(e, { padding: "8px 4px 8px 22px" }))] }, e.key))
|
|
1633
1813
|
})
|
|
1634
1814
|
]
|
|
1635
1815
|
});
|
|
1636
1816
|
}
|
|
1637
|
-
function
|
|
1817
|
+
function vt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
1638
1818
|
let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
1639
1819
|
return e.length ? /* @__PURE__ */ f("div", {
|
|
1640
1820
|
ref: r,
|
|
1641
1821
|
style: {
|
|
1642
1822
|
width: "100%",
|
|
1643
|
-
...
|
|
1823
|
+
...P(n)
|
|
1644
1824
|
},
|
|
1645
1825
|
children: [/* @__PURE__ */ d("div", {
|
|
1646
1826
|
style: {
|
|
@@ -1674,7 +1854,7 @@ function ct({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
1674
1854
|
}, e.key))]
|
|
1675
1855
|
}) : null;
|
|
1676
1856
|
}
|
|
1677
|
-
function
|
|
1857
|
+
function yt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
|
|
1678
1858
|
let [a, o] = l(() => new Set(e.length ? [e[0].key] : []));
|
|
1679
1859
|
if (!e.length) return null;
|
|
1680
1860
|
let s = (e) => o((t) => {
|
|
@@ -1685,7 +1865,7 @@ function lt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1685
1865
|
ref: i,
|
|
1686
1866
|
style: {
|
|
1687
1867
|
width: "100%",
|
|
1688
|
-
...
|
|
1868
|
+
...P(r)
|
|
1689
1869
|
},
|
|
1690
1870
|
children: e.map((n, r) => {
|
|
1691
1871
|
let i = a.has(n.key);
|
|
@@ -1731,15 +1911,15 @@ function lt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1731
1911
|
})
|
|
1732
1912
|
});
|
|
1733
1913
|
}
|
|
1734
|
-
var
|
|
1914
|
+
var bt = {
|
|
1735
1915
|
display: "flex",
|
|
1736
1916
|
flexDirection: "column",
|
|
1737
1917
|
gap: "12px"
|
|
1738
|
-
},
|
|
1918
|
+
}, Z = {
|
|
1739
1919
|
fontSize: "14px",
|
|
1740
1920
|
fontWeight: 500,
|
|
1741
1921
|
color: "var(--page-text, #111827)"
|
|
1742
|
-
},
|
|
1922
|
+
}, Q = {
|
|
1743
1923
|
padding: "10px 12px",
|
|
1744
1924
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
1745
1925
|
borderRadius: "6px",
|
|
@@ -1749,18 +1929,18 @@ var ut = {
|
|
|
1749
1929
|
boxSizing: "border-box",
|
|
1750
1930
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
1751
1931
|
color: "var(--page-text, #111827)"
|
|
1752
|
-
},
|
|
1932
|
+
}, xt = {
|
|
1753
1933
|
display: "flex",
|
|
1754
1934
|
alignItems: "center",
|
|
1755
1935
|
gap: "8px",
|
|
1756
1936
|
fontSize: "14px",
|
|
1757
1937
|
color: "var(--page-text, #111827)"
|
|
1758
|
-
},
|
|
1938
|
+
}, $ = (e) => e ? {
|
|
1759
1939
|
readOnly: !0,
|
|
1760
1940
|
tabIndex: -1,
|
|
1761
1941
|
onMouseDown: (e) => e.preventDefault()
|
|
1762
1942
|
} : {};
|
|
1763
|
-
function
|
|
1943
|
+
function St(e, t) {
|
|
1764
1944
|
if (!e) return !0;
|
|
1765
1945
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
1766
1946
|
switch (e.op) {
|
|
@@ -1774,11 +1954,11 @@ function ft(e, t) {
|
|
|
1774
1954
|
default: return !1;
|
|
1775
1955
|
}
|
|
1776
1956
|
}
|
|
1777
|
-
var
|
|
1957
|
+
var Ct = {
|
|
1778
1958
|
display: "flex",
|
|
1779
1959
|
flexDirection: "column",
|
|
1780
1960
|
gap: 6
|
|
1781
|
-
},
|
|
1961
|
+
}, wt = {
|
|
1782
1962
|
font: "inherit",
|
|
1783
1963
|
fontSize: 15,
|
|
1784
1964
|
padding: "10px 12px",
|
|
@@ -1789,16 +1969,16 @@ var pt = {
|
|
|
1789
1969
|
width: "100%",
|
|
1790
1970
|
boxSizing: "border-box"
|
|
1791
1971
|
};
|
|
1792
|
-
function
|
|
1972
|
+
function Tt(e, t) {
|
|
1793
1973
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
1794
1974
|
if (!e?.parentField) return n;
|
|
1795
1975
|
let r = t?.[e.parentField];
|
|
1796
1976
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
1797
1977
|
}
|
|
1798
|
-
function
|
|
1978
|
+
function Et({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
1799
1979
|
let a = /* @__PURE__ */ f("span", {
|
|
1800
1980
|
style: {
|
|
1801
|
-
...
|
|
1981
|
+
...Z,
|
|
1802
1982
|
fontSize: 14
|
|
1803
1983
|
},
|
|
1804
1984
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -1807,7 +1987,7 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1807
1987
|
required: e.required || void 0,
|
|
1808
1988
|
placeholder: e.placeholder || void 0,
|
|
1809
1989
|
disabled: r || void 0,
|
|
1810
|
-
style:
|
|
1990
|
+
style: wt,
|
|
1811
1991
|
value: t ?? "",
|
|
1812
1992
|
onChange: (t) => n(e.name, t.target.value)
|
|
1813
1993
|
};
|
|
@@ -1836,7 +2016,7 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1836
2016
|
borderRadius: 8,
|
|
1837
2017
|
display: "block"
|
|
1838
2018
|
}
|
|
1839
|
-
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(
|
|
2019
|
+
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(tt, {
|
|
1840
2020
|
url: e.src,
|
|
1841
2021
|
style: { width: "100%" }
|
|
1842
2022
|
}) : /* @__PURE__ */ d("video", {
|
|
@@ -1848,14 +2028,14 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1848
2028
|
display: "block"
|
|
1849
2029
|
}
|
|
1850
2030
|
}) : null : /* @__PURE__ */ f("label", {
|
|
1851
|
-
style:
|
|
2031
|
+
style: Ct,
|
|
1852
2032
|
children: [
|
|
1853
2033
|
a,
|
|
1854
2034
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
|
|
1855
2035
|
...o,
|
|
1856
2036
|
rows: 4,
|
|
1857
2037
|
style: {
|
|
1858
|
-
...
|
|
2038
|
+
...wt,
|
|
1859
2039
|
resize: "vertical"
|
|
1860
2040
|
}
|
|
1861
2041
|
}) : e.type === "select" ? /* @__PURE__ */ f("select", {
|
|
@@ -1864,7 +2044,7 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1864
2044
|
children: [/* @__PURE__ */ d("option", {
|
|
1865
2045
|
value: "",
|
|
1866
2046
|
children: e.placeholder || "—"
|
|
1867
|
-
}),
|
|
2047
|
+
}), Tt(e, i).map((e, t) => /* @__PURE__ */ d("option", {
|
|
1868
2048
|
value: typeof e == "string" ? e : e.value,
|
|
1869
2049
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
1870
2050
|
}, t))]
|
|
@@ -1911,8 +2091,8 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1911
2091
|
]
|
|
1912
2092
|
});
|
|
1913
2093
|
}
|
|
1914
|
-
function
|
|
1915
|
-
let { tenant: y, apiUrl: b } = i(
|
|
2094
|
+
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 }) {
|
|
2095
|
+
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
2096
|
a(() => {
|
|
1917
2097
|
if (!c || !s) return;
|
|
1918
2098
|
let e = !0;
|
|
@@ -1925,21 +2105,21 @@ function _t({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1925
2105
|
y,
|
|
1926
2106
|
b
|
|
1927
2107
|
]);
|
|
1928
|
-
let
|
|
2108
|
+
let A = [{
|
|
1929
2109
|
section: null,
|
|
1930
2110
|
fields: []
|
|
1931
2111
|
}];
|
|
1932
|
-
for (let e of Array.isArray(C?.fields) ? C.fields : []) e.type === "section" ?
|
|
2112
|
+
for (let e of Array.isArray(C?.fields) ? C.fields : []) e.type === "section" ? A.push({
|
|
1933
2113
|
section: e,
|
|
1934
2114
|
fields: []
|
|
1935
|
-
}) :
|
|
1936
|
-
let
|
|
2115
|
+
}) : A[A.length - 1].fields.push(e);
|
|
2116
|
+
let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section || St(e.section.condition, T)).map((e) => ({
|
|
1937
2117
|
...e,
|
|
1938
|
-
fields: e.fields.filter((e) =>
|
|
1939
|
-
})),
|
|
2118
|
+
fields: e.fields.filter((e) => St(e.condition, T))
|
|
2119
|
+
})), 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
2120
|
let t = T[e.name];
|
|
1941
2121
|
return e.required && (t == null || t === "" || t === !1);
|
|
1942
|
-
}),
|
|
2122
|
+
}), R = F >= M.length - 1, z = (e, t) => E((n) => {
|
|
1943
2123
|
let r = {
|
|
1944
2124
|
...n,
|
|
1945
2125
|
[e]: t
|
|
@@ -1949,7 +2129,7 @@ function _t({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1949
2129
|
});
|
|
1950
2130
|
return /* @__PURE__ */ f("div", {
|
|
1951
2131
|
ref: m,
|
|
1952
|
-
style:
|
|
2132
|
+
style: P(e),
|
|
1953
2133
|
children: [
|
|
1954
2134
|
/* @__PURE__ */ d("form", {
|
|
1955
2135
|
action: t || void 0,
|
|
@@ -1993,28 +2173,28 @@ function _t({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1993
2173
|
}
|
|
1994
2174
|
},
|
|
1995
2175
|
style: {
|
|
1996
|
-
...
|
|
1997
|
-
display:
|
|
2176
|
+
...bt,
|
|
2177
|
+
display: k === "success" ? "none" : "flex"
|
|
1998
2178
|
},
|
|
1999
2179
|
children: c && s ? /* @__PURE__ */ f(u, { children: [
|
|
2000
|
-
|
|
2001
|
-
steps:
|
|
2180
|
+
N && /* @__PURE__ */ d(tn, {
|
|
2181
|
+
steps: M.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2002
2182
|
active: F + 1,
|
|
2003
2183
|
style: { marginBottom: 8 }
|
|
2004
2184
|
}),
|
|
2005
|
-
|
|
2185
|
+
N && M[F]?.section?.help && /* @__PURE__ */ d("p", {
|
|
2006
2186
|
style: {
|
|
2007
2187
|
margin: 0,
|
|
2008
2188
|
fontSize: 14,
|
|
2009
2189
|
opacity: .7
|
|
2010
2190
|
},
|
|
2011
|
-
children:
|
|
2191
|
+
children: M[F].section.help
|
|
2012
2192
|
}),
|
|
2013
|
-
|
|
2193
|
+
I.map((e) => /* @__PURE__ */ d(Et, {
|
|
2014
2194
|
field: e,
|
|
2015
2195
|
value: T[e.name],
|
|
2016
2196
|
values: T,
|
|
2017
|
-
onChange:
|
|
2197
|
+
onChange: z,
|
|
2018
2198
|
inert: h
|
|
2019
2199
|
}, e.name)),
|
|
2020
2200
|
/* @__PURE__ */ f("div", {
|
|
@@ -2024,12 +2204,12 @@ function _t({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2024
2204
|
alignItems: "center",
|
|
2025
2205
|
marginTop: 4
|
|
2026
2206
|
},
|
|
2027
|
-
children: [
|
|
2207
|
+
children: [N && F > 0 && /* @__PURE__ */ d("button", {
|
|
2028
2208
|
type: "button",
|
|
2029
2209
|
disabled: h || void 0,
|
|
2030
|
-
onClick: () =>
|
|
2210
|
+
onClick: () => O(F - 1),
|
|
2031
2211
|
style: {
|
|
2032
|
-
...
|
|
2212
|
+
...Y,
|
|
2033
2213
|
background: "transparent",
|
|
2034
2214
|
color: "inherit",
|
|
2035
2215
|
border: 0,
|
|
@@ -2037,26 +2217,26 @@ function _t({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2037
2217
|
cursor: "pointer"
|
|
2038
2218
|
},
|
|
2039
2219
|
children: "Back"
|
|
2040
|
-
}),
|
|
2220
|
+
}), N && !R ? /* @__PURE__ */ d("button", {
|
|
2041
2221
|
type: "button",
|
|
2042
|
-
disabled: h ||
|
|
2043
|
-
onClick: () =>
|
|
2222
|
+
disabled: h || L.length > 0,
|
|
2223
|
+
onClick: () => O(F + 1),
|
|
2044
2224
|
style: {
|
|
2045
|
-
...
|
|
2225
|
+
...Y,
|
|
2046
2226
|
border: 0,
|
|
2047
2227
|
padding: "10px 22px",
|
|
2048
2228
|
borderRadius: 8,
|
|
2049
2229
|
fontSize: 15,
|
|
2050
2230
|
fontWeight: 600,
|
|
2051
2231
|
cursor: "pointer",
|
|
2052
|
-
opacity:
|
|
2232
|
+
opacity: L.length ? .5 : 1
|
|
2053
2233
|
},
|
|
2054
2234
|
children: "Next"
|
|
2055
2235
|
}) : /* @__PURE__ */ d("button", {
|
|
2056
2236
|
type: "submit",
|
|
2057
2237
|
disabled: h || void 0,
|
|
2058
2238
|
style: {
|
|
2059
|
-
...
|
|
2239
|
+
...Y,
|
|
2060
2240
|
border: 0,
|
|
2061
2241
|
padding: "10px 22px",
|
|
2062
2242
|
borderRadius: 8,
|
|
@@ -2070,12 +2250,12 @@ function _t({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2070
2250
|
] }) : g
|
|
2071
2251
|
}),
|
|
2072
2252
|
/* @__PURE__ */ d("div", {
|
|
2073
|
-
style: { display:
|
|
2253
|
+
style: { display: k === "success" ? "block" : "none" },
|
|
2074
2254
|
children: _?.success ?? null
|
|
2075
2255
|
}),
|
|
2076
2256
|
/* @__PURE__ */ d("div", {
|
|
2077
2257
|
style: {
|
|
2078
|
-
display:
|
|
2258
|
+
display: k === "error" ? "block" : "none",
|
|
2079
2259
|
marginTop: 12
|
|
2080
2260
|
},
|
|
2081
2261
|
children: _?.error ?? null
|
|
@@ -2083,10 +2263,10 @@ function _t({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2083
2263
|
]
|
|
2084
2264
|
});
|
|
2085
2265
|
}
|
|
2086
|
-
var
|
|
2266
|
+
var Ot = null, kt = null, At = (e) => {
|
|
2087
2267
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2088
|
-
if (
|
|
2089
|
-
if (
|
|
2268
|
+
if (Ot && kt === t) return Ot;
|
|
2269
|
+
if (Ot && typeof window < "u") {
|
|
2090
2270
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2091
2271
|
delete window[e];
|
|
2092
2272
|
} catch {
|
|
@@ -2094,22 +2274,22 @@ var X = null, vt = null, yt = (e) => {
|
|
|
2094
2274
|
}
|
|
2095
2275
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2096
2276
|
}
|
|
2097
|
-
return
|
|
2277
|
+
return kt = t, Ot = new Promise((e) => {
|
|
2098
2278
|
if (typeof window > "u") return;
|
|
2099
2279
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2100
2280
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2101
2281
|
let n = document.createElement("script");
|
|
2102
2282
|
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
|
-
}),
|
|
2283
|
+
}), Ot;
|
|
2104
2284
|
};
|
|
2105
|
-
function
|
|
2106
|
-
let p = i(
|
|
2285
|
+
function jt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l, onChange: u }) {
|
|
2286
|
+
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
2287
|
if (_.current = u, a(() => {
|
|
2108
2288
|
if (l || !h || !g.current) return;
|
|
2109
2289
|
let e = !0, i = (t) => {
|
|
2110
2290
|
e && typeof _.current == "function" && _.current(t);
|
|
2111
2291
|
};
|
|
2112
|
-
return
|
|
2292
|
+
return At(r).then((r) => {
|
|
2113
2293
|
if (!(!e || !g.current || !r?.render)) {
|
|
2114
2294
|
g.current.innerHTML = "", i("");
|
|
2115
2295
|
try {
|
|
@@ -2136,7 +2316,7 @@ function bt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert:
|
|
|
2136
2316
|
let e = t === "dark";
|
|
2137
2317
|
return /* @__PURE__ */ f("div", {
|
|
2138
2318
|
ref: s,
|
|
2139
|
-
style:
|
|
2319
|
+
style: P(o),
|
|
2140
2320
|
children: [/* @__PURE__ */ f("div", {
|
|
2141
2321
|
style: {
|
|
2142
2322
|
width: n === "compact" ? 164 : 302,
|
|
@@ -2187,21 +2367,21 @@ function bt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert:
|
|
|
2187
2367
|
}
|
|
2188
2368
|
return h ? /* @__PURE__ */ d("div", {
|
|
2189
2369
|
ref: s,
|
|
2190
|
-
style:
|
|
2370
|
+
style: P(o),
|
|
2191
2371
|
children: /* @__PURE__ */ d("div", { ref: g })
|
|
2192
2372
|
}) : null;
|
|
2193
2373
|
}
|
|
2194
|
-
function
|
|
2374
|
+
function Mt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2195
2375
|
return /* @__PURE__ */ d("label", {
|
|
2196
2376
|
ref: r,
|
|
2197
2377
|
style: {
|
|
2198
|
-
...
|
|
2199
|
-
...
|
|
2378
|
+
...Z,
|
|
2379
|
+
...P(n)
|
|
2200
2380
|
},
|
|
2201
|
-
children:
|
|
2381
|
+
children: X(t, e, i)
|
|
2202
2382
|
});
|
|
2203
2383
|
}
|
|
2204
|
-
function
|
|
2384
|
+
function Nt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2205
2385
|
return /* @__PURE__ */ d("input", {
|
|
2206
2386
|
ref: a,
|
|
2207
2387
|
type: e,
|
|
@@ -2209,13 +2389,13 @@ function St({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2209
2389
|
placeholder: n,
|
|
2210
2390
|
required: !o && !!r,
|
|
2211
2391
|
style: {
|
|
2212
|
-
...
|
|
2213
|
-
...
|
|
2392
|
+
...Q,
|
|
2393
|
+
...P(i)
|
|
2214
2394
|
},
|
|
2215
|
-
|
|
2395
|
+
...$(o)
|
|
2216
2396
|
});
|
|
2217
2397
|
}
|
|
2218
|
-
function
|
|
2398
|
+
function Pt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2219
2399
|
return /* @__PURE__ */ d("textarea", {
|
|
2220
2400
|
ref: a,
|
|
2221
2401
|
name: e || void 0,
|
|
@@ -2223,19 +2403,19 @@ function Ct({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2223
2403
|
rows: n,
|
|
2224
2404
|
required: !o && !!r,
|
|
2225
2405
|
style: {
|
|
2226
|
-
...
|
|
2406
|
+
...Q,
|
|
2227
2407
|
resize: "vertical",
|
|
2228
|
-
...
|
|
2408
|
+
...P(i)
|
|
2229
2409
|
},
|
|
2230
|
-
|
|
2410
|
+
...$(o)
|
|
2231
2411
|
});
|
|
2232
2412
|
}
|
|
2233
|
-
function
|
|
2413
|
+
function Ft({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2234
2414
|
return /* @__PURE__ */ f("label", {
|
|
2235
2415
|
ref: o,
|
|
2236
2416
|
style: {
|
|
2237
|
-
...
|
|
2238
|
-
...
|
|
2417
|
+
...xt,
|
|
2418
|
+
...P(a)
|
|
2239
2419
|
},
|
|
2240
2420
|
children: [/* @__PURE__ */ d("input", {
|
|
2241
2421
|
type: e,
|
|
@@ -2251,7 +2431,7 @@ function wt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
2251
2431
|
}), t]
|
|
2252
2432
|
});
|
|
2253
2433
|
}
|
|
2254
|
-
function
|
|
2434
|
+
function It({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
2255
2435
|
return /* @__PURE__ */ f("select", {
|
|
2256
2436
|
ref: a,
|
|
2257
2437
|
name: e || void 0,
|
|
@@ -2260,9 +2440,9 @@ function Tt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2260
2440
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
2261
2441
|
tabIndex: o ? -1 : void 0,
|
|
2262
2442
|
style: {
|
|
2263
|
-
...
|
|
2443
|
+
...Q,
|
|
2264
2444
|
appearance: "auto",
|
|
2265
|
-
...
|
|
2445
|
+
...P(i)
|
|
2266
2446
|
},
|
|
2267
2447
|
children: [t !== "" && /* @__PURE__ */ d("option", {
|
|
2268
2448
|
value: "",
|
|
@@ -2274,19 +2454,19 @@ function Tt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2274
2454
|
}, t))]
|
|
2275
2455
|
});
|
|
2276
2456
|
}
|
|
2277
|
-
function
|
|
2457
|
+
function Lt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
2278
2458
|
let [s, c] = l(null);
|
|
2279
2459
|
return /* @__PURE__ */ f("label", {
|
|
2280
2460
|
ref: a,
|
|
2281
2461
|
style: {
|
|
2282
|
-
...
|
|
2462
|
+
...Q,
|
|
2283
2463
|
display: "flex",
|
|
2284
2464
|
alignItems: "center",
|
|
2285
2465
|
gap: "8px",
|
|
2286
2466
|
cursor: o ? "default" : "pointer",
|
|
2287
2467
|
borderStyle: "dashed",
|
|
2288
2468
|
color: s ? "#111827" : "#6b7280",
|
|
2289
|
-
...
|
|
2469
|
+
...P(i)
|
|
2290
2470
|
},
|
|
2291
2471
|
children: [
|
|
2292
2472
|
/* @__PURE__ */ d("input", {
|
|
@@ -2306,12 +2486,12 @@ function Et({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
2306
2486
|
]
|
|
2307
2487
|
});
|
|
2308
2488
|
}
|
|
2309
|
-
function
|
|
2489
|
+
function Rt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
2310
2490
|
return /* @__PURE__ */ d("button", {
|
|
2311
2491
|
ref: n,
|
|
2312
2492
|
type: r ? "button" : "submit",
|
|
2313
2493
|
style: {
|
|
2314
|
-
...
|
|
2494
|
+
...Y,
|
|
2315
2495
|
border: 0,
|
|
2316
2496
|
cursor: "pointer",
|
|
2317
2497
|
alignSelf: "flex-start",
|
|
@@ -2321,12 +2501,12 @@ function Dt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
2321
2501
|
fontWeight: 600,
|
|
2322
2502
|
lineHeight: 1.4,
|
|
2323
2503
|
fontFamily: "inherit",
|
|
2324
|
-
...
|
|
2504
|
+
...P(t)
|
|
2325
2505
|
},
|
|
2326
2506
|
children: e
|
|
2327
2507
|
});
|
|
2328
2508
|
}
|
|
2329
|
-
function
|
|
2509
|
+
function zt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
2330
2510
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
2331
2511
|
return /* @__PURE__ */ d("div", {
|
|
2332
2512
|
ref: r,
|
|
@@ -2335,7 +2515,7 @@ function Ot({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2335
2515
|
gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
|
|
2336
2516
|
gap: 16,
|
|
2337
2517
|
width: "100%",
|
|
2338
|
-
...
|
|
2518
|
+
...P(n)
|
|
2339
2519
|
},
|
|
2340
2520
|
children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ d("div", {
|
|
2341
2521
|
style: { minWidth: 0 },
|
|
@@ -2343,8 +2523,8 @@ function Ot({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2343
2523
|
}, t))
|
|
2344
2524
|
});
|
|
2345
2525
|
}
|
|
2346
|
-
function
|
|
2347
|
-
let { tenant: v, apiUrl: y, locale: b } = i(
|
|
2526
|
+
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: _ }) {
|
|
2527
|
+
let { tenant: v, apiUrl: y, locale: b } = i(K), x = i(Ce), S = i(q), [, C] = l(0);
|
|
2348
2528
|
a(() => {
|
|
2349
2529
|
if (typeof window > "u") return;
|
|
2350
2530
|
let e = () => C((e) => e + 1);
|
|
@@ -2352,19 +2532,19 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2352
2532
|
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
2353
2533
|
};
|
|
2354
2534
|
}, []);
|
|
2355
|
-
let w =
|
|
2535
|
+
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
2536
|
if (a(() => {
|
|
2357
|
-
if (!e ||
|
|
2537
|
+
if (!e || D) return;
|
|
2358
2538
|
let n = !0, r = new URLSearchParams();
|
|
2359
2539
|
if (b && r.set("locale", b), E && r.set("data_filter", T), m && !e.startsWith("api:")) {
|
|
2360
2540
|
let e = Math.max(1, Number(t) || 6);
|
|
2361
|
-
r.set("offset", String((
|
|
2541
|
+
r.set("offset", String((O - 1) * e)), r.set("limit", String(e));
|
|
2362
2542
|
}
|
|
2363
2543
|
let i = r.toString(), a = e.startsWith("api:") ? `${y}/data/${encodeURIComponent(e.slice(4))}` : `${y}/dynamic/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
|
|
2364
2544
|
return fetch(a, { headers: v ? { "x-tenant": v } : {} }).then((e) => e.json()).then((e) => {
|
|
2365
2545
|
let t = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
|
|
2366
|
-
return n &&
|
|
2367
|
-
}).catch(() => n &&
|
|
2546
|
+
return n && A(t.filter((e) => e && typeof e == "object"));
|
|
2547
|
+
}).catch(() => n && A([])), () => {
|
|
2368
2548
|
n = !1;
|
|
2369
2549
|
};
|
|
2370
2550
|
}, [
|
|
@@ -2372,20 +2552,20 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2372
2552
|
v,
|
|
2373
2553
|
y,
|
|
2374
2554
|
b,
|
|
2375
|
-
|
|
2555
|
+
D,
|
|
2376
2556
|
m,
|
|
2377
|
-
|
|
2557
|
+
O,
|
|
2378
2558
|
t,
|
|
2379
2559
|
E,
|
|
2380
2560
|
T
|
|
2381
2561
|
]), !e) return null;
|
|
2382
|
-
let
|
|
2562
|
+
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
2563
|
display: "flex",
|
|
2384
2564
|
flexDirection: "column",
|
|
2385
2565
|
gap: 20
|
|
2386
2566
|
} : {
|
|
2387
2567
|
display: "grid",
|
|
2388
|
-
gridTemplateColumns: `repeat(${
|
|
2568
|
+
gridTemplateColumns: `repeat(${N}, minmax(0, 1fr))`,
|
|
2389
2569
|
gap: 24
|
|
2390
2570
|
};
|
|
2391
2571
|
return u && p && x?.render ? /* @__PURE__ */ d("div", {
|
|
@@ -2393,21 +2573,21 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2393
2573
|
style: {
|
|
2394
2574
|
width: "100%",
|
|
2395
2575
|
...F,
|
|
2396
|
-
...
|
|
2576
|
+
...P(g)
|
|
2397
2577
|
},
|
|
2398
|
-
children:
|
|
2578
|
+
children: M.map((e) => /* @__PURE__ */ d("div", {
|
|
2399
2579
|
style: { minWidth: 0 },
|
|
2400
|
-
children: x.render(p, (t) =>
|
|
2580
|
+
children: x.render(p, (t) => De(t, e))
|
|
2401
2581
|
}, e.id ?? e?.data?.slug))
|
|
2402
2582
|
}) : /* @__PURE__ */ d("div", {
|
|
2403
2583
|
ref: _,
|
|
2404
2584
|
style: {
|
|
2405
2585
|
width: "100%",
|
|
2406
2586
|
...F,
|
|
2407
|
-
...
|
|
2587
|
+
...P(g)
|
|
2408
2588
|
},
|
|
2409
|
-
children:
|
|
2410
|
-
let t = o ?
|
|
2589
|
+
children: M.map((e) => {
|
|
2590
|
+
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
2591
|
return /* @__PURE__ */ f("div", {
|
|
2412
2592
|
style: {
|
|
2413
2593
|
display: "flex",
|
|
@@ -2454,7 +2634,7 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2454
2634
|
lineHeight: 1.55,
|
|
2455
2635
|
opacity: .85
|
|
2456
2636
|
},
|
|
2457
|
-
children:
|
|
2637
|
+
children: Ue(a)
|
|
2458
2638
|
})
|
|
2459
2639
|
]
|
|
2460
2640
|
})]
|
|
@@ -2462,8 +2642,8 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2462
2642
|
})
|
|
2463
2643
|
});
|
|
2464
2644
|
}
|
|
2465
|
-
function
|
|
2466
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
2645
|
+
function Vt({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
2646
|
+
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : xe(), s = {
|
|
2467
2647
|
height: 34,
|
|
2468
2648
|
padding: "0 12px",
|
|
2469
2649
|
borderRadius: 8,
|
|
@@ -2505,13 +2685,13 @@ function At({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2505
2685
|
alignItems: "center",
|
|
2506
2686
|
gap: 8,
|
|
2507
2687
|
width: "100%",
|
|
2508
|
-
...
|
|
2688
|
+
...P(n)
|
|
2509
2689
|
},
|
|
2510
2690
|
children: [a.map((e) => Array.isArray(e.options) && e.options.length > 0 || e.type === "option" || e.type === "select" ? /* @__PURE__ */ f("select", {
|
|
2511
2691
|
name: `f_${e.name}`,
|
|
2512
2692
|
defaultValue: o[e.name] ?? "",
|
|
2513
2693
|
style: s,
|
|
2514
|
-
|
|
2694
|
+
...$(i),
|
|
2515
2695
|
children: [/* @__PURE__ */ d("option", {
|
|
2516
2696
|
value: "",
|
|
2517
2697
|
children: e.label || e.name
|
|
@@ -2526,7 +2706,7 @@ function At({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2526
2706
|
name: `f_${e.name}`,
|
|
2527
2707
|
defaultValue: o[e.name] ?? "",
|
|
2528
2708
|
style: s,
|
|
2529
|
-
|
|
2709
|
+
...$(i),
|
|
2530
2710
|
children: [
|
|
2531
2711
|
/* @__PURE__ */ d("option", {
|
|
2532
2712
|
value: "",
|
|
@@ -2547,7 +2727,7 @@ function At({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2547
2727
|
defaultValue: o[e.name] ?? "",
|
|
2548
2728
|
placeholder: e.label || e.name,
|
|
2549
2729
|
style: s,
|
|
2550
|
-
|
|
2730
|
+
...$(i)
|
|
2551
2731
|
}, e.name)), /* @__PURE__ */ d("button", {
|
|
2552
2732
|
type: "submit",
|
|
2553
2733
|
style: {
|
|
@@ -2560,16 +2740,16 @@ function At({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2560
2740
|
fontWeight: 600,
|
|
2561
2741
|
cursor: i ? "default" : "pointer"
|
|
2562
2742
|
},
|
|
2563
|
-
|
|
2743
|
+
...$(i),
|
|
2564
2744
|
children: t
|
|
2565
2745
|
})]
|
|
2566
2746
|
});
|
|
2567
2747
|
}
|
|
2568
|
-
function
|
|
2748
|
+
function Ht({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
2569
2749
|
return e.length ? /* @__PURE__ */ d("nav", {
|
|
2570
2750
|
ref: r,
|
|
2571
2751
|
"aria-label": "Breadcrumb",
|
|
2572
|
-
style: { ...
|
|
2752
|
+
style: { ...P(n) },
|
|
2573
2753
|
children: /* @__PURE__ */ d("ol", {
|
|
2574
2754
|
style: {
|
|
2575
2755
|
display: "flex",
|
|
@@ -2615,8 +2795,8 @@ function jt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2615
2795
|
})
|
|
2616
2796
|
}) : null;
|
|
2617
2797
|
}
|
|
2618
|
-
function
|
|
2619
|
-
let { tenant: g, apiUrl: _ } = i(
|
|
2798
|
+
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 }) {
|
|
2799
|
+
let { tenant: g, apiUrl: _ } = i(K), v = i(q), [y, b] = l(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
2620
2800
|
a(() => {
|
|
2621
2801
|
if (!o || Number.isFinite(x)) return;
|
|
2622
2802
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -2635,7 +2815,7 @@ function Mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
2635
2815
|
]);
|
|
2636
2816
|
let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
|
|
2637
2817
|
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 ?
|
|
2818
|
+
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
2819
|
if (o) {
|
|
2640
2820
|
if (typeof window < "u") {
|
|
2641
2821
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -2644,7 +2824,7 @@ function Mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
2644
2824
|
return `?page=${e}`;
|
|
2645
2825
|
}
|
|
2646
2826
|
return r && r !== "#" ? r.replace("{page}", String(e)) : "#";
|
|
2647
|
-
},
|
|
2827
|
+
}, D = c === "center" ? "center" : c === "right" ? "flex-end" : "flex-start", O = p ? (e) => e.preventDefault() : void 0, k = (e) => ({
|
|
2648
2828
|
display: "inline-flex",
|
|
2649
2829
|
alignItems: "center",
|
|
2650
2830
|
justifyContent: "center",
|
|
@@ -2666,33 +2846,33 @@ function Mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
2666
2846
|
flexWrap: "wrap",
|
|
2667
2847
|
gap: 8,
|
|
2668
2848
|
alignItems: "center",
|
|
2669
|
-
justifyContent:
|
|
2670
|
-
...
|
|
2849
|
+
justifyContent: D,
|
|
2850
|
+
...P(m)
|
|
2671
2851
|
},
|
|
2672
2852
|
children: [
|
|
2673
2853
|
n && /* @__PURE__ */ d("a", {
|
|
2674
2854
|
href: T > 1 ? E(T - 1) : "#",
|
|
2675
|
-
onClick:
|
|
2855
|
+
onClick: O,
|
|
2676
2856
|
"aria-label": "Previous",
|
|
2677
2857
|
style: {
|
|
2678
|
-
...
|
|
2858
|
+
...k(!1),
|
|
2679
2859
|
opacity: T > 1 ? 1 : .4
|
|
2680
2860
|
},
|
|
2681
2861
|
children: "‹"
|
|
2682
2862
|
}),
|
|
2683
2863
|
Array.from({ length: w }, (e, t) => t + 1).map((e) => /* @__PURE__ */ d("a", {
|
|
2684
2864
|
href: E(e),
|
|
2685
|
-
onClick:
|
|
2865
|
+
onClick: O,
|
|
2686
2866
|
"aria-current": e === T ? "page" : void 0,
|
|
2687
|
-
style:
|
|
2867
|
+
style: k(e === T),
|
|
2688
2868
|
children: e
|
|
2689
2869
|
}, e)),
|
|
2690
2870
|
n && /* @__PURE__ */ d("a", {
|
|
2691
2871
|
href: T < w ? E(T + 1) : "#",
|
|
2692
|
-
onClick:
|
|
2872
|
+
onClick: O,
|
|
2693
2873
|
"aria-label": "Next",
|
|
2694
2874
|
style: {
|
|
2695
|
-
...
|
|
2875
|
+
...k(!1),
|
|
2696
2876
|
opacity: T < w ? 1 : .4
|
|
2697
2877
|
},
|
|
2698
2878
|
children: "›"
|
|
@@ -2700,15 +2880,15 @@ function Mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
2700
2880
|
]
|
|
2701
2881
|
});
|
|
2702
2882
|
}
|
|
2703
|
-
var
|
|
2883
|
+
var Wt = "webim.page_mode", Gt = () => {
|
|
2704
2884
|
if (typeof window > "u") return "auto";
|
|
2705
2885
|
try {
|
|
2706
|
-
let e = window.localStorage.getItem(
|
|
2886
|
+
let e = window.localStorage.getItem(Wt);
|
|
2707
2887
|
return e === "light" || e === "dark" ? e : "auto";
|
|
2708
2888
|
} catch {
|
|
2709
2889
|
return "auto";
|
|
2710
2890
|
}
|
|
2711
|
-
},
|
|
2891
|
+
}, Kt = (e) => {
|
|
2712
2892
|
let t = {
|
|
2713
2893
|
width: 16,
|
|
2714
2894
|
height: 16,
|
|
@@ -2740,13 +2920,13 @@ var Nt = "webim.page_mode", Pt = () => {
|
|
|
2740
2920
|
rx: "2"
|
|
2741
2921
|
}), /* @__PURE__ */ d("path", { d: "M8 21h8M12 17v4" })]
|
|
2742
2922
|
});
|
|
2743
|
-
},
|
|
2923
|
+
}, qt = {
|
|
2744
2924
|
light: "Light theme",
|
|
2745
2925
|
dark: "Dark theme",
|
|
2746
2926
|
auto: "Follow the device theme"
|
|
2747
2927
|
};
|
|
2748
|
-
function
|
|
2749
|
-
let [o, s] = l(i ? "auto" :
|
|
2928
|
+
function Jt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
2929
|
+
let [o, s] = l(i ? "auto" : Gt), u = c(null), f = (e) => {
|
|
2750
2930
|
u.current = e, typeof r == "function" && r(e);
|
|
2751
2931
|
};
|
|
2752
2932
|
a(() => {
|
|
@@ -2754,7 +2934,7 @@ function It({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
2754
2934
|
let e = u.current?.closest?.(".webim-page");
|
|
2755
2935
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
2756
2936
|
try {
|
|
2757
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
2937
|
+
o === "auto" ? window.localStorage.removeItem(Wt) : window.localStorage.setItem(Wt, o);
|
|
2758
2938
|
} catch {}
|
|
2759
2939
|
}, [o, i]);
|
|
2760
2940
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -2785,12 +2965,12 @@ function It({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
2785
2965
|
padding: 3,
|
|
2786
2966
|
borderRadius: 999,
|
|
2787
2967
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
2788
|
-
...
|
|
2968
|
+
...P(n)
|
|
2789
2969
|
},
|
|
2790
2970
|
children: p.map((e) => /* @__PURE__ */ d("button", {
|
|
2791
2971
|
type: "button",
|
|
2792
|
-
title:
|
|
2793
|
-
"aria-label":
|
|
2972
|
+
title: qt[e],
|
|
2973
|
+
"aria-label": qt[e],
|
|
2794
2974
|
"aria-pressed": e === m,
|
|
2795
2975
|
onClick: i ? void 0 : () => s(e),
|
|
2796
2976
|
style: {
|
|
@@ -2801,27 +2981,27 @@ function It({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
2801
2981
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
2802
2982
|
opacity: e === m ? 1 : .7
|
|
2803
2983
|
},
|
|
2804
|
-
children:
|
|
2984
|
+
children: Kt(e)
|
|
2805
2985
|
}, e))
|
|
2806
2986
|
});
|
|
2807
2987
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
2808
2988
|
return /* @__PURE__ */ d("button", {
|
|
2809
2989
|
ref: f,
|
|
2810
2990
|
type: "button",
|
|
2811
|
-
title:
|
|
2812
|
-
"aria-label": `Theme: ${
|
|
2991
|
+
title: qt[m],
|
|
2992
|
+
"aria-label": `Theme: ${qt[m]} — switch to ${qt[g]}`,
|
|
2813
2993
|
onClick: i ? void 0 : () => s(g),
|
|
2814
2994
|
style: {
|
|
2815
2995
|
...h,
|
|
2816
2996
|
width: 36,
|
|
2817
2997
|
height: 36,
|
|
2818
2998
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
2819
|
-
...
|
|
2999
|
+
...P(n)
|
|
2820
3000
|
},
|
|
2821
|
-
children:
|
|
3001
|
+
children: Kt(m)
|
|
2822
3002
|
});
|
|
2823
3003
|
}
|
|
2824
|
-
function
|
|
3004
|
+
function Yt(e) {
|
|
2825
3005
|
let t = e?.parentElement;
|
|
2826
3006
|
for (; t && t !== document.body;) {
|
|
2827
3007
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -2830,7 +3010,7 @@ function Lt(e) {
|
|
|
2830
3010
|
}
|
|
2831
3011
|
return window;
|
|
2832
3012
|
}
|
|
2833
|
-
var
|
|
3013
|
+
var Xt = (e) => e === window ? window.scrollY : e.scrollTop, Zt = {
|
|
2834
3014
|
"bottom-right": (e) => ({
|
|
2835
3015
|
right: e,
|
|
2836
3016
|
bottom: e
|
|
@@ -2845,7 +3025,7 @@ var Rt = (e) => e === window ? window.scrollY : e.scrollTop, zt = {
|
|
|
2845
3025
|
transform: "translateX(-50%)"
|
|
2846
3026
|
})
|
|
2847
3027
|
};
|
|
2848
|
-
function
|
|
3028
|
+
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
3029
|
let [_, v] = l(!!m), [y, b] = l(null), x = (e) => {
|
|
2850
3030
|
b(e), typeof p == "function" && p(e);
|
|
2851
3031
|
};
|
|
@@ -2856,8 +3036,8 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
2856
3036
|
}
|
|
2857
3037
|
if (!y) return;
|
|
2858
3038
|
let e = Number(i) >= 0 ? Number(i) : 300, t = () => {
|
|
2859
|
-
let t =
|
|
2860
|
-
v(n ||
|
|
3039
|
+
let t = Yt(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
3040
|
+
v(n || Xt(t) > e);
|
|
2861
3041
|
};
|
|
2862
3042
|
return t(), document.addEventListener("scroll", t, {
|
|
2863
3043
|
capture: !0,
|
|
@@ -2871,7 +3051,7 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
2871
3051
|
]);
|
|
2872
3052
|
let S = () => {
|
|
2873
3053
|
if (m) return;
|
|
2874
|
-
let e =
|
|
3054
|
+
let e = Yt(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
2875
3055
|
e === window ? window.scrollTo({
|
|
2876
3056
|
top: 0,
|
|
2877
3057
|
behavior: n
|
|
@@ -2879,7 +3059,7 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
2879
3059
|
top: 0,
|
|
2880
3060
|
behavior: n
|
|
2881
3061
|
});
|
|
2882
|
-
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E =
|
|
3062
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = Zt[n] ? n : "bottom-right", D = h ? {
|
|
2883
3063
|
position: "fixed",
|
|
2884
3064
|
zIndex: 5,
|
|
2885
3065
|
bottom: (h.bottom ?? 0) + C,
|
|
@@ -2892,7 +3072,7 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
2892
3072
|
} : {
|
|
2893
3073
|
position: "fixed",
|
|
2894
3074
|
zIndex: 2147482e3,
|
|
2895
|
-
...
|
|
3075
|
+
...Zt[E](C)
|
|
2896
3076
|
};
|
|
2897
3077
|
return /* @__PURE__ */ f("button", {
|
|
2898
3078
|
ref: x,
|
|
@@ -2923,9 +3103,9 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
2923
3103
|
opacity: +!!_,
|
|
2924
3104
|
pointerEvents: _ ? "auto" : "none",
|
|
2925
3105
|
transition: "opacity 160ms ease, transform 160ms ease",
|
|
2926
|
-
...
|
|
2927
|
-
...
|
|
2928
|
-
...
|
|
3106
|
+
...D,
|
|
3107
|
+
...P(u),
|
|
3108
|
+
...D.transform ? { transform: D.transform } : null
|
|
2929
3109
|
},
|
|
2930
3110
|
children: [/* @__PURE__ */ d("svg", {
|
|
2931
3111
|
width: "18",
|
|
@@ -2943,7 +3123,7 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
2943
3123
|
}), w ? /* @__PURE__ */ d("span", { children: T }) : null]
|
|
2944
3124
|
});
|
|
2945
3125
|
}
|
|
2946
|
-
var
|
|
3126
|
+
var $t = {
|
|
2947
3127
|
facebook: {
|
|
2948
3128
|
label: "Facebook",
|
|
2949
3129
|
color: "#1877f2",
|
|
@@ -3010,8 +3190,8 @@ var Vt = {
|
|
|
3010
3190
|
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
3191
|
}
|
|
3012
3192
|
};
|
|
3013
|
-
function
|
|
3014
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
3193
|
+
function en({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
3194
|
+
let l = Array.isArray(e) ? e.filter((e) => e && $t[e.network]) : [];
|
|
3015
3195
|
if (!l.length) return null;
|
|
3016
3196
|
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
3197
|
return /* @__PURE__ */ d("div", {
|
|
@@ -3021,10 +3201,10 @@ function Ht({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3021
3201
|
flexWrap: "wrap",
|
|
3022
3202
|
alignItems: "center",
|
|
3023
3203
|
gap: p,
|
|
3024
|
-
...
|
|
3204
|
+
...P(o)
|
|
3025
3205
|
},
|
|
3026
3206
|
children: l.map((e, r) => {
|
|
3027
|
-
let i =
|
|
3207
|
+
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
3208
|
return /* @__PURE__ */ d("a", {
|
|
3029
3209
|
href: e.url || "#",
|
|
3030
3210
|
onClick: h,
|
|
@@ -3058,7 +3238,7 @@ function Ht({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3058
3238
|
})
|
|
3059
3239
|
});
|
|
3060
3240
|
}
|
|
3061
|
-
function
|
|
3241
|
+
function tn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
3062
3242
|
if (!e.length) return null;
|
|
3063
3243
|
let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
|
|
3064
3244
|
width: 32,
|
|
@@ -3096,7 +3276,7 @@ function Ut({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3096
3276
|
flexDirection: r ? "column" : "row",
|
|
3097
3277
|
alignItems: r ? "stretch" : "flex-start",
|
|
3098
3278
|
gap: r ? 4 : 8,
|
|
3099
|
-
...
|
|
3279
|
+
...P(i)
|
|
3100
3280
|
},
|
|
3101
3281
|
children: e.map((e, n) => {
|
|
3102
3282
|
let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
|
|
@@ -3136,7 +3316,7 @@ function Ut({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3136
3316
|
})
|
|
3137
3317
|
});
|
|
3138
3318
|
}
|
|
3139
|
-
var
|
|
3319
|
+
var nn = {
|
|
3140
3320
|
small: {
|
|
3141
3321
|
w: 132,
|
|
3142
3322
|
h: 46,
|
|
@@ -3158,10 +3338,10 @@ var Wt = {
|
|
|
3158
3338
|
title: 12.5,
|
|
3159
3339
|
avatar: 46
|
|
3160
3340
|
}
|
|
3161
|
-
},
|
|
3162
|
-
|
|
3163
|
-
function
|
|
3164
|
-
let r =
|
|
3341
|
+
}, rn = (e) => nn[e] ?? nn.medium;
|
|
3342
|
+
nn.medium.w, nn.medium.h;
|
|
3343
|
+
function an(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
3344
|
+
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
3345
|
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
3346
|
let d = /* @__PURE__ */ new Map(), f = (e, t) => {
|
|
3167
3347
|
if (t.has(e.id)) return 0;
|
|
@@ -3213,19 +3393,19 @@ function Kt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
|
3213
3393
|
horizontal: n
|
|
3214
3394
|
};
|
|
3215
3395
|
}
|
|
3216
|
-
var
|
|
3396
|
+
var on = (e, t) => {
|
|
3217
3397
|
let n = String(e ?? "");
|
|
3218
3398
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
3219
|
-
},
|
|
3399
|
+
}, sn = (e) => {
|
|
3220
3400
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
3221
3401
|
if (!t) return "#ffffff";
|
|
3222
3402
|
let n = t[1];
|
|
3223
3403
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
3224
3404
|
let r = parseInt(n, 16);
|
|
3225
3405
|
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 ? "" :
|
|
3406
|
+
}, cn = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
3407
|
+
function ln(e, t = {}) {
|
|
3408
|
+
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
3409
|
return n.map((e) => {
|
|
3230
3410
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
3231
3411
|
return {
|
|
@@ -3239,11 +3419,11 @@ function Xt(e, t = {}) {
|
|
|
3239
3419
|
};
|
|
3240
3420
|
});
|
|
3241
3421
|
}
|
|
3242
|
-
var
|
|
3422
|
+
var un = {
|
|
3243
3423
|
size: 36,
|
|
3244
3424
|
pad: 10
|
|
3245
3425
|
};
|
|
3246
|
-
function
|
|
3426
|
+
function dn({ node: e, onClose: t }) {
|
|
3247
3427
|
return a(() => {
|
|
3248
3428
|
let e = (e) => e.key === "Escape" && t();
|
|
3249
3429
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -3364,15 +3544,15 @@ function Qt({ node: e, onClose: t }) {
|
|
|
3364
3544
|
})
|
|
3365
3545
|
});
|
|
3366
3546
|
}
|
|
3367
|
-
function
|
|
3368
|
-
let b = o(), [x, S] = l(null), { tenant: C, apiUrl: w } = i(
|
|
3547
|
+
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 }) {
|
|
3548
|
+
let b = o(), [x, S] = l(null), { tenant: C, apiUrl: w } = i(K), T = i(q)?.[t], [E, D] = l(null);
|
|
3369
3549
|
a(() => {
|
|
3370
3550
|
if (!t || T) return;
|
|
3371
3551
|
let e = !0;
|
|
3372
3552
|
return fetch(`${w}/dynamic/${encodeURIComponent(t)}`, { headers: C ? { "x-tenant": C } : {} }).then((e) => e.json()).then((t) => {
|
|
3373
3553
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
3374
|
-
e &&
|
|
3375
|
-
}).catch(() => e &&
|
|
3554
|
+
e && D(n);
|
|
3555
|
+
}).catch(() => e && D([])), () => {
|
|
3376
3556
|
e = !1;
|
|
3377
3557
|
};
|
|
3378
3558
|
}, [
|
|
@@ -3381,18 +3561,18 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3381
3561
|
w,
|
|
3382
3562
|
T
|
|
3383
3563
|
]);
|
|
3384
|
-
let
|
|
3564
|
+
let O = t ? ln(T ?? E ?? [], {
|
|
3385
3565
|
nameField: n,
|
|
3386
3566
|
titleField: r,
|
|
3387
3567
|
photoField: s,
|
|
3388
3568
|
parentField: c,
|
|
3389
3569
|
cvField: p,
|
|
3390
3570
|
hrefField: m
|
|
3391
|
-
}) : e,
|
|
3571
|
+
}) : e, k = rn(h), { boxes: A, links: j, width: M, height: N } = an(O, {
|
|
3392
3572
|
size: h,
|
|
3393
3573
|
horizontal: g
|
|
3394
3574
|
});
|
|
3395
|
-
if (!
|
|
3575
|
+
if (!A.length) return !y && t ? /* @__PURE__ */ f("div", {
|
|
3396
3576
|
ref: v,
|
|
3397
3577
|
style: {
|
|
3398
3578
|
padding: 18,
|
|
@@ -3401,7 +3581,7 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3401
3581
|
fontSize: 13,
|
|
3402
3582
|
opacity: .7,
|
|
3403
3583
|
textAlign: "center",
|
|
3404
|
-
...
|
|
3584
|
+
...P(_)
|
|
3405
3585
|
},
|
|
3406
3586
|
children: [
|
|
3407
3587
|
"Org Chart — no published entries in “",
|
|
@@ -3409,32 +3589,32 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3409
3589
|
"” yet"
|
|
3410
3590
|
]
|
|
3411
3591
|
}) : null;
|
|
3412
|
-
let F = new Set(
|
|
3592
|
+
let F = new Set(A.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
|
|
3413
3593
|
return /* @__PURE__ */ f("div", {
|
|
3414
3594
|
ref: v,
|
|
3415
3595
|
style: {
|
|
3416
3596
|
maxWidth: "100%",
|
|
3417
3597
|
overflowX: "auto",
|
|
3418
|
-
...
|
|
3598
|
+
...P(_)
|
|
3419
3599
|
},
|
|
3420
3600
|
children: [/* @__PURE__ */ f("svg", {
|
|
3421
|
-
viewBox: `0 0 ${
|
|
3601
|
+
viewBox: `0 0 ${M} ${N}`,
|
|
3422
3602
|
role: "img",
|
|
3423
3603
|
"aria-label": "Organization chart",
|
|
3424
3604
|
style: {
|
|
3425
3605
|
display: "block",
|
|
3426
3606
|
width: "100%",
|
|
3427
|
-
maxWidth:
|
|
3607
|
+
maxWidth: M,
|
|
3428
3608
|
height: "auto",
|
|
3429
3609
|
margin: "0 auto"
|
|
3430
3610
|
},
|
|
3431
|
-
children: [
|
|
3611
|
+
children: [j.map((e, t) => /* @__PURE__ */ d("path", {
|
|
3432
3612
|
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
3613
|
fill: "none",
|
|
3434
3614
|
stroke: "rgba(148, 163, 184, 0.7)",
|
|
3435
3615
|
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 ?
|
|
3616
|
+
}, t)), A.map(({ node: e, x: t, y: n }) => {
|
|
3617
|
+
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
3618
|
return /* @__PURE__ */ f("g", {
|
|
3439
3619
|
onClick: l ? p : void 0,
|
|
3440
3620
|
style: l ? { cursor: "pointer" } : void 0,
|
|
@@ -3457,8 +3637,8 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3457
3637
|
}), /* @__PURE__ */ d("rect", {
|
|
3458
3638
|
x: t,
|
|
3459
3639
|
y: n,
|
|
3460
|
-
width:
|
|
3461
|
-
height:
|
|
3640
|
+
width: k.w,
|
|
3641
|
+
height: k.h,
|
|
3462
3642
|
rx: "10",
|
|
3463
3643
|
fill: `url(#${b}-${e.id}-grad)`
|
|
3464
3644
|
})] }) : i ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
@@ -3466,8 +3646,8 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3466
3646
|
children: /* @__PURE__ */ d("rect", {
|
|
3467
3647
|
x: t,
|
|
3468
3648
|
y: n,
|
|
3469
|
-
width:
|
|
3470
|
-
height:
|
|
3649
|
+
width: k.w,
|
|
3650
|
+
height: k.h,
|
|
3471
3651
|
rx: "10"
|
|
3472
3652
|
})
|
|
3473
3653
|
}), /* @__PURE__ */ f("g", {
|
|
@@ -3475,21 +3655,21 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3475
3655
|
children: [/* @__PURE__ */ d("rect", {
|
|
3476
3656
|
x: t,
|
|
3477
3657
|
y: n,
|
|
3478
|
-
width:
|
|
3658
|
+
width: k.w,
|
|
3479
3659
|
height: _,
|
|
3480
3660
|
fill: o
|
|
3481
3661
|
}), /* @__PURE__ */ d("rect", {
|
|
3482
3662
|
x: t,
|
|
3483
3663
|
y: n + _,
|
|
3484
|
-
width:
|
|
3485
|
-
height:
|
|
3664
|
+
width: k.w,
|
|
3665
|
+
height: k.h - _,
|
|
3486
3666
|
fill: e.color2
|
|
3487
3667
|
})]
|
|
3488
3668
|
})] }) : /* @__PURE__ */ d("rect", {
|
|
3489
3669
|
x: t,
|
|
3490
3670
|
y: n,
|
|
3491
|
-
width:
|
|
3492
|
-
height:
|
|
3671
|
+
width: k.w,
|
|
3672
|
+
height: k.h,
|
|
3493
3673
|
rx: "10",
|
|
3494
3674
|
fill: o,
|
|
3495
3675
|
stroke: a ? "none" : "var(--page-accent, #4f46e5)",
|
|
@@ -3498,63 +3678,63 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3498
3678
|
e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
3499
3679
|
id: `${b}-${e.id}`,
|
|
3500
3680
|
children: /* @__PURE__ */ d("circle", {
|
|
3501
|
-
cx: t +
|
|
3502
|
-
cy: n +
|
|
3503
|
-
r:
|
|
3681
|
+
cx: t + un.pad + k.avatar / 2,
|
|
3682
|
+
cy: n + k.h / 2,
|
|
3683
|
+
r: k.avatar / 2
|
|
3504
3684
|
})
|
|
3505
3685
|
}), /* @__PURE__ */ d("image", {
|
|
3506
3686
|
href: e.photo,
|
|
3507
|
-
x: t +
|
|
3508
|
-
y: n + (
|
|
3509
|
-
width:
|
|
3510
|
-
height:
|
|
3687
|
+
x: t + un.pad,
|
|
3688
|
+
y: n + (k.h - k.avatar) / 2,
|
|
3689
|
+
width: k.avatar,
|
|
3690
|
+
height: k.avatar,
|
|
3511
3691
|
preserveAspectRatio: "xMidYMid slice",
|
|
3512
3692
|
clipPath: `url(#${b}-${e.id})`
|
|
3513
3693
|
})] }),
|
|
3514
3694
|
i && !e.gradient ? /* @__PURE__ */ f(u, { children: [e.title && /* @__PURE__ */ d("text", {
|
|
3515
3695
|
x: m,
|
|
3516
|
-
y: n + _ / 2 +
|
|
3696
|
+
y: n + _ / 2 + k.title * .35,
|
|
3517
3697
|
textAnchor: h,
|
|
3518
|
-
fontSize:
|
|
3698
|
+
fontSize: k.title,
|
|
3519
3699
|
fontWeight: "600",
|
|
3520
3700
|
fill: s,
|
|
3521
|
-
children:
|
|
3701
|
+
children: on(e.title, g + 4)
|
|
3522
3702
|
}), e.name && /* @__PURE__ */ d("text", {
|
|
3523
3703
|
x: m,
|
|
3524
|
-
y: n + _ + _ / 2 +
|
|
3704
|
+
y: n + _ + _ / 2 + k.name * .35,
|
|
3525
3705
|
textAnchor: h,
|
|
3526
|
-
fontSize:
|
|
3706
|
+
fontSize: k.name,
|
|
3527
3707
|
fontWeight: "600",
|
|
3528
3708
|
fill: c,
|
|
3529
|
-
children:
|
|
3709
|
+
children: on(e.name, g)
|
|
3530
3710
|
})] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
|
|
3531
3711
|
x: m,
|
|
3532
|
-
y: n + (v[1] ?
|
|
3712
|
+
y: n + (v[1] ? k.h * .43 : k.h * .57),
|
|
3533
3713
|
textAnchor: h,
|
|
3534
|
-
fontSize:
|
|
3714
|
+
fontSize: k.name,
|
|
3535
3715
|
fontWeight: "600",
|
|
3536
3716
|
fill: s,
|
|
3537
|
-
children:
|
|
3717
|
+
children: on(v[0], g)
|
|
3538
3718
|
}), v[1] && /* @__PURE__ */ d("text", {
|
|
3539
3719
|
x: m,
|
|
3540
|
-
y: n +
|
|
3720
|
+
y: n + k.h * .73,
|
|
3541
3721
|
textAnchor: h,
|
|
3542
|
-
fontSize:
|
|
3722
|
+
fontSize: k.title,
|
|
3543
3723
|
opacity: "0.7",
|
|
3544
3724
|
fill: s,
|
|
3545
|
-
children:
|
|
3725
|
+
children: on(v[1], g + 4)
|
|
3546
3726
|
})] })
|
|
3547
3727
|
]
|
|
3548
3728
|
}, e.id);
|
|
3549
3729
|
})]
|
|
3550
|
-
}), x && /* @__PURE__ */ d(
|
|
3730
|
+
}), x && /* @__PURE__ */ d(dn, {
|
|
3551
3731
|
node: x,
|
|
3552
3732
|
onClose: () => S(null)
|
|
3553
3733
|
})]
|
|
3554
3734
|
});
|
|
3555
3735
|
}
|
|
3556
|
-
function
|
|
3557
|
-
let { tenant: g, apiUrl: _ } = i(
|
|
3736
|
+
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 }) {
|
|
3737
|
+
let { tenant: g, apiUrl: _ } = i(K), v = i(q), y = v?.[n], b = u ? be(v) : 1, [x, S] = l(null);
|
|
3558
3738
|
if (a(() => {
|
|
3559
3739
|
if (!n || y) return;
|
|
3560
3740
|
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 +3753,45 @@ function en({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
|
|
|
3573
3753
|
b,
|
|
3574
3754
|
r
|
|
3575
3755
|
]), !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) =>
|
|
3756
|
+
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
3757
|
return /* @__PURE__ */ d("div", {
|
|
3578
3758
|
ref: h,
|
|
3579
3759
|
style: {
|
|
3580
3760
|
width: "100%",
|
|
3581
3761
|
overflowX: "auto",
|
|
3582
|
-
...
|
|
3762
|
+
...P(m)
|
|
3583
3763
|
},
|
|
3584
3764
|
children: /* @__PURE__ */ f("table", {
|
|
3585
3765
|
style: {
|
|
3586
3766
|
width: "100%",
|
|
3587
3767
|
borderCollapse: "collapse",
|
|
3588
3768
|
fontSize: 14,
|
|
3589
|
-
...s ? { border:
|
|
3769
|
+
...s ? { border: O } : {}
|
|
3590
3770
|
},
|
|
3591
3771
|
children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e.map((e, t) => /* @__PURE__ */ d("th", {
|
|
3592
3772
|
style: {
|
|
3593
3773
|
textAlign: "left",
|
|
3594
3774
|
fontWeight: 600,
|
|
3595
|
-
padding:
|
|
3775
|
+
padding: D,
|
|
3596
3776
|
background: "rgba(148, 163, 184, 0.12)",
|
|
3597
|
-
...
|
|
3777
|
+
...k
|
|
3598
3778
|
},
|
|
3599
3779
|
children: e.label ?? e
|
|
3600
3780
|
}, t)) }) }), /* @__PURE__ */ f("tbody", { children: [E && /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
|
|
3601
3781
|
colSpan: e.length,
|
|
3602
3782
|
style: {
|
|
3603
|
-
padding:
|
|
3783
|
+
padding: D,
|
|
3604
3784
|
textAlign: "center",
|
|
3605
3785
|
opacity: .6,
|
|
3606
|
-
...
|
|
3786
|
+
...k
|
|
3607
3787
|
},
|
|
3608
3788
|
children: p || "No data yet"
|
|
3609
3789
|
}) }), T.map((t, n) => /* @__PURE__ */ d("tr", {
|
|
3610
3790
|
style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
|
|
3611
3791
|
children: e.map((e, n) => /* @__PURE__ */ d("td", {
|
|
3612
3792
|
style: {
|
|
3613
|
-
padding:
|
|
3614
|
-
...
|
|
3793
|
+
padding: D,
|
|
3794
|
+
...k
|
|
3615
3795
|
},
|
|
3616
3796
|
children: t?.[n] ?? ""
|
|
3617
3797
|
}, n))
|
|
@@ -3619,124 +3799,642 @@ function en({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
|
|
|
3619
3799
|
})
|
|
3620
3800
|
});
|
|
3621
3801
|
}
|
|
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
|
-
|
|
3802
|
+
var mn = {
|
|
3803
|
+
small: {
|
|
3804
|
+
cell: 62,
|
|
3805
|
+
font: 10.5,
|
|
3806
|
+
head: 11,
|
|
3807
|
+
title: 15,
|
|
3808
|
+
pad: 4,
|
|
3809
|
+
gap: 2
|
|
3810
|
+
},
|
|
3811
|
+
medium: {
|
|
3812
|
+
cell: 92,
|
|
3813
|
+
font: 12,
|
|
3814
|
+
head: 12,
|
|
3815
|
+
title: 18,
|
|
3816
|
+
pad: 6,
|
|
3817
|
+
gap: 3
|
|
3818
|
+
},
|
|
3819
|
+
large: {
|
|
3820
|
+
cell: 124,
|
|
3821
|
+
font: 13,
|
|
3822
|
+
head: 13,
|
|
3823
|
+
title: 22,
|
|
3824
|
+
pad: 8,
|
|
3825
|
+
gap: 4
|
|
3826
|
+
}
|
|
3827
|
+
}, 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;
|
|
3828
|
+
function vn(e, t = {}) {
|
|
3829
|
+
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) => {
|
|
3830
|
+
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
3831
|
+
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
3832
|
+
};
|
|
3833
|
+
return n.map((e) => {
|
|
3834
|
+
let n = e.data ?? {}, o = a(n[t.startField]);
|
|
3835
|
+
return o ? {
|
|
3836
|
+
key: e.id,
|
|
3837
|
+
title: i(n[t.titleField || "name"]) || i(n.name) || "Untitled",
|
|
3838
|
+
start: o,
|
|
3839
|
+
end: a(n[t.endField]),
|
|
3840
|
+
href: t.hrefField ? i(n[t.hrefField]) : "",
|
|
3841
|
+
color: t.colorField ? i(r(n[t.colorField])) : ""
|
|
3842
|
+
} : null;
|
|
3843
|
+
}).filter(Boolean);
|
|
3844
|
+
}
|
|
3845
|
+
function yn(e) {
|
|
3846
|
+
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
3847
|
+
let n = e?.start ? new Date(e.start) : null;
|
|
3848
|
+
if (!n || Number.isNaN(n.getTime())) return null;
|
|
3849
|
+
let r = e?.end ? new Date(e.end) : null;
|
|
3850
|
+
return {
|
|
3851
|
+
key: e.key ?? `event-${t}`,
|
|
3852
|
+
title: e.title ?? "",
|
|
3853
|
+
start: n,
|
|
3854
|
+
end: r && !Number.isNaN(r.getTime()) ? r : null,
|
|
3855
|
+
href: e.href ?? "",
|
|
3856
|
+
color: e.color ?? ""
|
|
3857
|
+
};
|
|
3858
|
+
}).filter(Boolean);
|
|
3859
|
+
}
|
|
3860
|
+
function bn(e) {
|
|
3861
|
+
let t = /* @__PURE__ */ new Map();
|
|
3862
|
+
for (let n of e) {
|
|
3863
|
+
let e = gn(n.start), r = n.end ? gn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), _n);
|
|
3864
|
+
for (let r = 0; r <= i; r += 1) {
|
|
3865
|
+
let i = hn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
3866
|
+
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
3867
|
+
}
|
|
3868
|
+
}
|
|
3869
|
+
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
3870
|
+
return t;
|
|
3871
|
+
}
|
|
3872
|
+
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 }) {
|
|
3873
|
+
let { tenant: T, apiUrl: E, locale: D } = i(K), O = i(q)?.[t], [k, A] = l(null), [j, M] = l(() => {
|
|
3874
|
+
let e = /* @__PURE__ */ new Date();
|
|
3875
|
+
return {
|
|
3876
|
+
year: e.getFullYear(),
|
|
3877
|
+
month: e.getMonth()
|
|
3878
|
+
};
|
|
3879
|
+
});
|
|
3880
|
+
a(() => {
|
|
3881
|
+
if (!t || O) return;
|
|
3882
|
+
let e = !0;
|
|
3883
|
+
return fetch(`${E}/dynamic/${encodeURIComponent(t)}`, { headers: T ? { "x-tenant": T } : {} }).then((e) => e.json()).then((t) => {
|
|
3884
|
+
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
3885
|
+
e && A(n);
|
|
3886
|
+
}).catch(() => e && A([])), () => {
|
|
3887
|
+
e = !1;
|
|
3888
|
+
};
|
|
3889
|
+
}, [
|
|
3890
|
+
t,
|
|
3891
|
+
T,
|
|
3892
|
+
E,
|
|
3893
|
+
O
|
|
3894
|
+
]);
|
|
3895
|
+
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 ?? [], {
|
|
3896
|
+
titleField: n,
|
|
3897
|
+
startField: r,
|
|
3898
|
+
endField: o,
|
|
3899
|
+
hrefField: s,
|
|
3900
|
+
colorField: c
|
|
3901
|
+
}) : yn(e), B = bn(z), V = D || void 0, H = (e, t) => {
|
|
3902
|
+
let n = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", { style: {
|
|
3903
|
+
width: 6,
|
|
3904
|
+
height: 6,
|
|
3905
|
+
borderRadius: "50%",
|
|
3906
|
+
background: e.color || R,
|
|
3907
|
+
flexShrink: 0,
|
|
3908
|
+
opacity: e.color ? 1 : .85
|
|
3909
|
+
} }), /* @__PURE__ */ d("span", {
|
|
3910
|
+
style: {
|
|
3911
|
+
overflow: "hidden",
|
|
3912
|
+
textOverflow: "ellipsis",
|
|
3913
|
+
whiteSpace: "nowrap"
|
|
3914
|
+
},
|
|
3915
|
+
children: e.title
|
|
3916
|
+
})] }), r = {
|
|
3917
|
+
display: "flex",
|
|
3918
|
+
alignItems: "center",
|
|
3919
|
+
gap: 5,
|
|
3920
|
+
background: e.color ? `color-mix(in srgb, ${e.color} 18%, transparent)` : L,
|
|
3921
|
+
color: e.color ? "inherit" : R,
|
|
3922
|
+
borderRadius: 4,
|
|
3923
|
+
padding: "2px 5px",
|
|
3924
|
+
fontSize: N.font,
|
|
3925
|
+
lineHeight: 1.35,
|
|
3926
|
+
textDecoration: "none",
|
|
3927
|
+
...t
|
|
3928
|
+
};
|
|
3929
|
+
return e.href && w ? /* @__PURE__ */ d("a", {
|
|
3930
|
+
href: e.href,
|
|
3931
|
+
style: r,
|
|
3932
|
+
title: e.title,
|
|
3933
|
+
children: n
|
|
3934
|
+
}, e.key) : /* @__PURE__ */ d("div", {
|
|
3935
|
+
style: r,
|
|
3936
|
+
title: e.title,
|
|
3937
|
+
children: n
|
|
3938
|
+
}, e.key);
|
|
3939
|
+
}, U = new Intl.DateTimeFormat(V, {
|
|
3940
|
+
month: "long",
|
|
3941
|
+
year: "numeric"
|
|
3942
|
+
}).format(new Date(j.year, j.month, 1)), ee = (e) => M((t) => {
|
|
3943
|
+
let n = new Date(t.year, t.month + e, 1);
|
|
3944
|
+
return {
|
|
3945
|
+
year: n.getFullYear(),
|
|
3946
|
+
month: n.getMonth()
|
|
3947
|
+
};
|
|
3948
|
+
}), te = (e, t) => /* @__PURE__ */ d("button", {
|
|
3949
|
+
type: "button",
|
|
3950
|
+
"aria-label": e,
|
|
3951
|
+
onClick: () => ee(t),
|
|
3952
|
+
style: {
|
|
3953
|
+
background: "transparent",
|
|
3954
|
+
border: `1px solid ${I}`,
|
|
3955
|
+
borderRadius: 6,
|
|
3956
|
+
color: "inherit",
|
|
3957
|
+
cursor: "pointer",
|
|
3958
|
+
fontSize: N.head,
|
|
3959
|
+
lineHeight: 1,
|
|
3960
|
+
padding: "4px 8px"
|
|
3961
|
+
},
|
|
3962
|
+
children: t < 0 ? "‹" : "›"
|
|
3963
|
+
}), W = /* @__PURE__ */ f("div", {
|
|
3964
|
+
style: {
|
|
3965
|
+
display: "flex",
|
|
3966
|
+
alignItems: "center",
|
|
3967
|
+
gap: 8,
|
|
3968
|
+
marginBottom: N.pad + 2
|
|
3969
|
+
},
|
|
3970
|
+
children: [
|
|
3971
|
+
/* @__PURE__ */ d("div", {
|
|
3972
|
+
style: {
|
|
3973
|
+
fontSize: N.title,
|
|
3974
|
+
fontWeight: 700,
|
|
3975
|
+
flexGrow: 1,
|
|
3976
|
+
fontFamily: "var(--page-heading-font, inherit)"
|
|
3977
|
+
},
|
|
3978
|
+
children: U
|
|
3979
|
+
}),
|
|
3980
|
+
te("Previous month", -1),
|
|
3981
|
+
te("Next month", 1)
|
|
3982
|
+
]
|
|
3983
|
+
});
|
|
3984
|
+
if (p === "list") {
|
|
3985
|
+
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, {
|
|
3986
|
+
day: "numeric",
|
|
3987
|
+
month: "short",
|
|
3988
|
+
hour: "2-digit",
|
|
3989
|
+
minute: "2-digit"
|
|
3990
|
+
});
|
|
3991
|
+
return /* @__PURE__ */ f("div", {
|
|
3992
|
+
ref: C,
|
|
3993
|
+
style: {
|
|
3994
|
+
width: "100%",
|
|
3995
|
+
...P(S)
|
|
3996
|
+
},
|
|
3997
|
+
children: [W, e.length ? /* @__PURE__ */ d("div", {
|
|
3998
|
+
style: {
|
|
3999
|
+
display: "flex",
|
|
4000
|
+
flexDirection: "column",
|
|
4001
|
+
gap: N.gap + 2
|
|
4002
|
+
},
|
|
4003
|
+
children: e.map((e) => /* @__PURE__ */ f("div", {
|
|
4004
|
+
style: {
|
|
4005
|
+
display: "flex",
|
|
4006
|
+
alignItems: "center",
|
|
4007
|
+
gap: 10,
|
|
4008
|
+
borderBottom: `1px solid ${I}`,
|
|
4009
|
+
paddingBottom: N.gap + 2
|
|
4010
|
+
},
|
|
4011
|
+
children: [/* @__PURE__ */ d("span", {
|
|
4012
|
+
style: {
|
|
4013
|
+
fontSize: N.font,
|
|
4014
|
+
opacity: .7,
|
|
4015
|
+
minWidth: 96
|
|
4016
|
+
},
|
|
4017
|
+
children: t.format(e.start)
|
|
4018
|
+
}), H(e, {
|
|
4019
|
+
flexGrow: 1,
|
|
4020
|
+
minWidth: 0
|
|
4021
|
+
})]
|
|
4022
|
+
}, e.key))
|
|
4023
|
+
}) : /* @__PURE__ */ d("div", {
|
|
4024
|
+
style: {
|
|
4025
|
+
fontSize: N.font,
|
|
4026
|
+
opacity: .6,
|
|
4027
|
+
padding: N.pad * 2
|
|
4028
|
+
},
|
|
4029
|
+
children: x
|
|
4030
|
+
})]
|
|
4031
|
+
});
|
|
4032
|
+
}
|
|
4033
|
+
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 = [];
|
|
4034
|
+
for (let e = 0; e < oe * 7; e += 1) {
|
|
4035
|
+
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;
|
|
4036
|
+
G.push(/* @__PURE__ */ f("div", {
|
|
4037
|
+
style: {
|
|
4038
|
+
minHeight: N.cell,
|
|
4039
|
+
borderTop: `1px solid ${I}`,
|
|
4040
|
+
borderLeft: `1px solid ${I}`,
|
|
4041
|
+
padding: N.pad,
|
|
4042
|
+
display: "flex",
|
|
4043
|
+
flexDirection: "column",
|
|
4044
|
+
gap: N.gap,
|
|
4045
|
+
opacity: n ? 1 : .35,
|
|
4046
|
+
minWidth: 0
|
|
4047
|
+
},
|
|
4048
|
+
children: [
|
|
4049
|
+
/* @__PURE__ */ d("span", {
|
|
4050
|
+
style: {
|
|
4051
|
+
fontSize: N.font,
|
|
4052
|
+
fontWeight: o ? 700 : 400,
|
|
4053
|
+
alignSelf: "flex-start",
|
|
4054
|
+
borderRadius: "999px",
|
|
4055
|
+
padding: o ? "1px 6px" : 0,
|
|
4056
|
+
background: o ? F : "transparent",
|
|
4057
|
+
color: o ? R : "inherit"
|
|
4058
|
+
},
|
|
4059
|
+
children: n ? t : new Date(j.year, j.month, t).getDate()
|
|
4060
|
+
}),
|
|
4061
|
+
a.map((e) => H(e)),
|
|
4062
|
+
i.length > a.length && /* @__PURE__ */ d("span", {
|
|
4063
|
+
style: {
|
|
4064
|
+
fontSize: N.font,
|
|
4065
|
+
opacity: .6
|
|
4066
|
+
},
|
|
4067
|
+
children: `+${i.length - a.length}`
|
|
4068
|
+
})
|
|
4069
|
+
]
|
|
4070
|
+
}, e));
|
|
4071
|
+
}
|
|
4072
|
+
return /* @__PURE__ */ f("div", {
|
|
4073
|
+
ref: C,
|
|
4074
|
+
style: {
|
|
4075
|
+
width: "100%",
|
|
4076
|
+
...P(S)
|
|
4077
|
+
},
|
|
4078
|
+
children: [
|
|
4079
|
+
W,
|
|
4080
|
+
/* @__PURE__ */ f("div", {
|
|
4081
|
+
style: {
|
|
4082
|
+
display: "grid",
|
|
4083
|
+
gridTemplateColumns: "repeat(7, minmax(0, 1fr))"
|
|
4084
|
+
},
|
|
4085
|
+
children: [Array.from({ length: 7 }, (e, t) => /* @__PURE__ */ d("div", {
|
|
4086
|
+
style: {
|
|
4087
|
+
fontSize: N.head,
|
|
4088
|
+
fontWeight: 600,
|
|
4089
|
+
opacity: .7,
|
|
4090
|
+
textAlign: "center",
|
|
4091
|
+
padding: `0 0 ${N.pad}px`
|
|
4092
|
+
},
|
|
4093
|
+
children: ce.format(new Date(2024, 0, 7 + re + t))
|
|
4094
|
+
}, `head-${t}`)), G]
|
|
4095
|
+
}),
|
|
4096
|
+
/* @__PURE__ */ d("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4097
|
+
]
|
|
4098
|
+
});
|
|
4099
|
+
}
|
|
4100
|
+
var Sn = {
|
|
4101
|
+
small: 380,
|
|
4102
|
+
medium: 560,
|
|
4103
|
+
large: 820,
|
|
4104
|
+
full: "100%"
|
|
4105
|
+
};
|
|
4106
|
+
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 }) {
|
|
4107
|
+
let [C, w] = l(!1), T = c(null);
|
|
4108
|
+
a(() => {
|
|
4109
|
+
if (S || !e) return;
|
|
4110
|
+
let t = (t) => {
|
|
4111
|
+
t.target.closest?.(`a[href="#${e}"], [data-webim-open="${e}"]`) && (t.preventDefault(), w(!0));
|
|
4112
|
+
};
|
|
4113
|
+
return document.addEventListener("click", t), () => document.removeEventListener("click", t);
|
|
4114
|
+
}, [S, e]), a(() => {
|
|
4115
|
+
if (S || r !== "load") return;
|
|
4116
|
+
let e = setTimeout(() => w(!0), Math.max(0, Number(i) || 0) * 1e3);
|
|
4117
|
+
return () => clearTimeout(e);
|
|
4118
|
+
}, [
|
|
4119
|
+
S,
|
|
4120
|
+
r,
|
|
4121
|
+
i
|
|
4122
|
+
]), a(() => {
|
|
4123
|
+
if (S || !C) return;
|
|
4124
|
+
let e = (e) => e.key === "Escape" && w(!1);
|
|
4125
|
+
document.addEventListener("keydown", e);
|
|
4126
|
+
let t = document.body.style.overflow;
|
|
4127
|
+
return document.body.style.overflow = "hidden", T.current?.focus?.(), () => {
|
|
4128
|
+
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
4129
|
+
};
|
|
4130
|
+
}, [S, C]);
|
|
4131
|
+
let E = Sn[o] ?? Sn.medium, D = (e) => {
|
|
4132
|
+
let t = {
|
|
4133
|
+
padding: "9px 16px",
|
|
4134
|
+
borderRadius: 6,
|
|
4135
|
+
cursor: "pointer",
|
|
4136
|
+
fontSize: 14,
|
|
4137
|
+
fontFamily: "inherit",
|
|
4138
|
+
textDecoration: "none",
|
|
4139
|
+
display: "inline-block",
|
|
4140
|
+
...{
|
|
4141
|
+
primary: {
|
|
4142
|
+
background: "var(--page-accent, #4f46e5)",
|
|
4143
|
+
color: "var(--page-accent-text, #ffffff)",
|
|
4144
|
+
border: "1px solid transparent"
|
|
4145
|
+
},
|
|
4146
|
+
outline: {
|
|
4147
|
+
background: "transparent",
|
|
4148
|
+
color: "inherit",
|
|
4149
|
+
border: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))"
|
|
4150
|
+
},
|
|
4151
|
+
text: {
|
|
4152
|
+
background: "transparent",
|
|
4153
|
+
color: "inherit",
|
|
4154
|
+
border: "1px solid transparent"
|
|
4155
|
+
},
|
|
4156
|
+
danger: {
|
|
4157
|
+
background: "#dc2626",
|
|
4158
|
+
color: "#ffffff",
|
|
4159
|
+
border: "1px solid transparent"
|
|
4160
|
+
}
|
|
4161
|
+
}[e.variant ?? "primary"] ?? {}
|
|
4162
|
+
};
|
|
4163
|
+
return e.href && !S ? /* @__PURE__ */ d("a", {
|
|
4164
|
+
href: e.href,
|
|
4165
|
+
target: e.target || void 0,
|
|
4166
|
+
rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
4167
|
+
style: t,
|
|
4168
|
+
children: e.label
|
|
4169
|
+
}, e.key) : /* @__PURE__ */ d("button", {
|
|
4170
|
+
type: "button",
|
|
4171
|
+
onClick: () => !S && w(!1),
|
|
4172
|
+
style: t,
|
|
4173
|
+
children: e.label
|
|
4174
|
+
}, e.key);
|
|
4175
|
+
}, O = Array.isArray(h) ? h : [], k = O.filter((e) => e.side === "left"), A = O.filter((e) => e.side !== "left"), j = g === !0 ? D({
|
|
4176
|
+
key: "__close",
|
|
4177
|
+
label: _ || "Close",
|
|
4178
|
+
variant: "outline"
|
|
4179
|
+
}) : null, M = k.length || A.length || j ? /* @__PURE__ */ f("div", {
|
|
4180
|
+
style: {
|
|
4181
|
+
display: "flex",
|
|
4182
|
+
alignItems: "center",
|
|
4183
|
+
gap: 8,
|
|
4184
|
+
padding: "14px 20px",
|
|
4185
|
+
borderTop: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))",
|
|
4186
|
+
justifyContent: k.length ? "space-between" : v === "left" ? "flex-start" : v === "center" ? "center" : "flex-end"
|
|
4187
|
+
},
|
|
4188
|
+
children: [k.length > 0 && /* @__PURE__ */ d("div", {
|
|
4189
|
+
style: {
|
|
4190
|
+
display: "flex",
|
|
4191
|
+
gap: 8
|
|
4192
|
+
},
|
|
4193
|
+
children: k.map(D)
|
|
4194
|
+
}), /* @__PURE__ */ f("div", {
|
|
4195
|
+
style: {
|
|
4196
|
+
display: "flex",
|
|
4197
|
+
gap: 8
|
|
4198
|
+
},
|
|
4199
|
+
children: [j, A.map(D)]
|
|
4200
|
+
})]
|
|
4201
|
+
}) : null, N = /* @__PURE__ */ f("div", {
|
|
4202
|
+
ref: T,
|
|
4203
|
+
role: "dialog",
|
|
4204
|
+
"aria-modal": S ? void 0 : "true",
|
|
4205
|
+
"aria-label": s || void 0,
|
|
4206
|
+
tabIndex: -1,
|
|
4207
|
+
onClick: (e) => e.stopPropagation(),
|
|
4208
|
+
style: {
|
|
4209
|
+
width: typeof E == "number" ? `min(${E}px, 100%)` : E,
|
|
4210
|
+
maxHeight: S ? void 0 : "85vh",
|
|
4211
|
+
overflowY: S ? void 0 : "auto",
|
|
4212
|
+
borderRadius: 12,
|
|
4213
|
+
background: "var(--page-surface, #ffffff)",
|
|
4214
|
+
color: "var(--page-text, #111827)",
|
|
4215
|
+
border: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))",
|
|
4216
|
+
boxShadow: S ? "none" : "0 24px 64px rgba(15, 23, 42, 0.35)",
|
|
4217
|
+
outline: "none",
|
|
4218
|
+
...P(b)
|
|
4219
|
+
},
|
|
4220
|
+
children: [
|
|
4221
|
+
(s || u !== !1) && /* @__PURE__ */ f("div", {
|
|
4222
|
+
style: {
|
|
4223
|
+
display: "flex",
|
|
4224
|
+
alignItems: "center",
|
|
4225
|
+
gap: 12,
|
|
4226
|
+
padding: "16px 20px",
|
|
4227
|
+
borderBottom: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))"
|
|
4228
|
+
},
|
|
4229
|
+
children: [/* @__PURE__ */ d("span", {
|
|
4230
|
+
style: {
|
|
4231
|
+
fontWeight: 700,
|
|
4232
|
+
fontSize: 17,
|
|
4233
|
+
flexGrow: 1,
|
|
4234
|
+
fontFamily: "var(--page-heading-font, inherit)"
|
|
4235
|
+
},
|
|
4236
|
+
children: s
|
|
4237
|
+
}), u !== !1 && /* @__PURE__ */ d("button", {
|
|
4238
|
+
type: "button",
|
|
4239
|
+
"aria-label": "Close",
|
|
4240
|
+
onClick: () => !S && w(!1),
|
|
4241
|
+
style: {
|
|
4242
|
+
background: "transparent",
|
|
4243
|
+
border: 0,
|
|
4244
|
+
color: "inherit",
|
|
4245
|
+
cursor: "pointer",
|
|
4246
|
+
fontSize: 20,
|
|
4247
|
+
lineHeight: 1,
|
|
4248
|
+
padding: 2,
|
|
4249
|
+
opacity: .7
|
|
4250
|
+
},
|
|
4251
|
+
children: "✕"
|
|
4252
|
+
})]
|
|
4253
|
+
}),
|
|
4254
|
+
/* @__PURE__ */ d("div", {
|
|
4255
|
+
style: { padding: 20 },
|
|
4256
|
+
children: y?.content
|
|
4257
|
+
}),
|
|
4258
|
+
M
|
|
4259
|
+
]
|
|
4260
|
+
});
|
|
4261
|
+
return /* @__PURE__ */ f("div", {
|
|
4262
|
+
ref: x,
|
|
4263
|
+
id: e || void 0,
|
|
4264
|
+
style: S ? void 0 : { display: "contents" },
|
|
4265
|
+
children: [t === "button" && /* @__PURE__ */ d("button", {
|
|
4266
|
+
type: "button",
|
|
4267
|
+
onClick: () => !S && w(!0),
|
|
4268
|
+
style: {
|
|
4269
|
+
padding: "10px 18px",
|
|
4270
|
+
border: 0,
|
|
4271
|
+
borderRadius: 6,
|
|
4272
|
+
cursor: "pointer",
|
|
4273
|
+
fontSize: 15,
|
|
4274
|
+
fontFamily: "inherit",
|
|
4275
|
+
background: "var(--page-accent, #4f46e5)",
|
|
4276
|
+
color: "var(--page-accent-text, #ffffff)"
|
|
4277
|
+
},
|
|
4278
|
+
children: n
|
|
4279
|
+
}), S ? /* @__PURE__ */ d("div", {
|
|
4280
|
+
style: { marginTop: t === "button" ? 12 : 0 },
|
|
4281
|
+
children: N
|
|
4282
|
+
}) : C && /* @__PURE__ */ d("div", {
|
|
4283
|
+
onClick: p === !1 ? void 0 : () => w(!1),
|
|
4284
|
+
style: {
|
|
4285
|
+
position: "fixed",
|
|
4286
|
+
inset: 0,
|
|
4287
|
+
zIndex: 2147483e3,
|
|
4288
|
+
display: "flex",
|
|
4289
|
+
alignItems: m === "top" ? "flex-start" : "center",
|
|
4290
|
+
justifyContent: "center",
|
|
4291
|
+
padding: 20,
|
|
4292
|
+
paddingTop: m === "top" ? "8vh" : 20,
|
|
4293
|
+
background: "rgba(15, 23, 42, 0.55)",
|
|
4294
|
+
backdropFilter: "blur(2px)"
|
|
4295
|
+
},
|
|
4296
|
+
children: N
|
|
4297
|
+
})]
|
|
4298
|
+
});
|
|
4299
|
+
}
|
|
4300
|
+
var wn = {
|
|
4301
|
+
PageRoot: Pe,
|
|
4302
|
+
CalendarBlock: xn,
|
|
4303
|
+
DialogBlock: Cn,
|
|
4304
|
+
Section: Fe,
|
|
4305
|
+
Container: Ie,
|
|
4306
|
+
Heading: Le,
|
|
4307
|
+
TextBlock: Je,
|
|
4308
|
+
ButtonBlock: Ze,
|
|
4309
|
+
ImageBlock: Qe,
|
|
4310
|
+
Spacer: it,
|
|
4311
|
+
Divider: at,
|
|
4312
|
+
SliderBlock: dt,
|
|
4313
|
+
CanvasSlider: ft,
|
|
4314
|
+
TabsBlock: vt,
|
|
4315
|
+
QuickStack: zt,
|
|
4316
|
+
CollectionList: Bt,
|
|
4317
|
+
CollectionSearch: Vt,
|
|
4318
|
+
BreadcrumbsBlock: Ht,
|
|
4319
|
+
PaginationBlock: Ut,
|
|
4320
|
+
StepperBlock: tn,
|
|
4321
|
+
SocialLinksBlock: en,
|
|
4322
|
+
ThemeModeBlock: Jt,
|
|
4323
|
+
ScrollTopBlock: Qt,
|
|
4324
|
+
OrgChartBlock: fn,
|
|
4325
|
+
TableBlock: pn,
|
|
4326
|
+
MasonryBlock: pt,
|
|
4327
|
+
AccordionBlock: yt,
|
|
4328
|
+
NavbarBlock: _t,
|
|
4329
|
+
ListBlock: qe,
|
|
4330
|
+
TextSpan: Be,
|
|
4331
|
+
QuoteBlock: Ke,
|
|
4332
|
+
TextLink: Xe,
|
|
4333
|
+
RichTextBlock: We,
|
|
4334
|
+
RichContentBlock: We,
|
|
4335
|
+
VideoBlock: $e,
|
|
4336
|
+
YouTubeBlock: tt,
|
|
4337
|
+
IframeBlock: nt,
|
|
4338
|
+
EmbedBlock: rt,
|
|
4339
|
+
FormBlock: Dt,
|
|
4340
|
+
FormLabel: Mt,
|
|
4341
|
+
FormInput: Nt,
|
|
4342
|
+
FormTextarea: Pt,
|
|
4343
|
+
FormCheckbox: (e) => /* @__PURE__ */ d(Ft, {
|
|
3664
4344
|
kind: "checkbox",
|
|
3665
4345
|
...e
|
|
3666
4346
|
}),
|
|
3667
|
-
FormRadio: (e) => /* @__PURE__ */ d(
|
|
4347
|
+
FormRadio: (e) => /* @__PURE__ */ d(Ft, {
|
|
3668
4348
|
kind: "radio",
|
|
3669
4349
|
...e
|
|
3670
4350
|
}),
|
|
3671
|
-
FormSelect:
|
|
3672
|
-
FormFile:
|
|
3673
|
-
FormRecaptcha:
|
|
3674
|
-
FormSubmit:
|
|
3675
|
-
},
|
|
4351
|
+
FormSelect: It,
|
|
4352
|
+
FormFile: Lt,
|
|
4353
|
+
FormRecaptcha: jt,
|
|
4354
|
+
FormSubmit: Rt
|
|
4355
|
+
}, Tn = {
|
|
3676
4356
|
id: "auth",
|
|
3677
4357
|
label: "Accounts",
|
|
3678
4358
|
category: "Apps",
|
|
3679
4359
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
3680
4360
|
ssr: "shell",
|
|
3681
4361
|
settings: ["site.authRedirect"]
|
|
3682
|
-
},
|
|
4362
|
+
}, En = n({
|
|
3683
4363
|
user: null,
|
|
3684
4364
|
status: "idle",
|
|
3685
4365
|
ensure: () => {},
|
|
3686
4366
|
refresh: () => {},
|
|
3687
4367
|
signOut: () => {}
|
|
3688
|
-
}),
|
|
3689
|
-
let e = i(
|
|
4368
|
+
}), Dn = () => {
|
|
4369
|
+
let e = i(En);
|
|
3690
4370
|
return a(() => {
|
|
3691
4371
|
e.ensure();
|
|
3692
4372
|
}, [e]), e;
|
|
3693
4373
|
};
|
|
3694
|
-
function
|
|
3695
|
-
let
|
|
4374
|
+
function On({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u }) {
|
|
4375
|
+
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
4376
|
...t,
|
|
3697
4377
|
credentials: "include",
|
|
3698
4378
|
headers: {
|
|
3699
4379
|
"content-type": "application/json",
|
|
3700
|
-
...
|
|
4380
|
+
...m ? { "x-tenant": m } : {},
|
|
3701
4381
|
...t?.headers
|
|
3702
4382
|
}
|
|
3703
|
-
}), [
|
|
4383
|
+
}), [p, m]), x = r(() => n ? Promise.resolve(null) : b("/site/me").then((e) => e.ok ? e.json() : null).then((e) => {
|
|
3704
4384
|
let t = e?.payload ?? null;
|
|
3705
|
-
return
|
|
3706
|
-
}).catch(() => (
|
|
3707
|
-
|
|
3708
|
-
}), [
|
|
3709
|
-
|
|
4385
|
+
return g(t), v(t ? "user" : "guest"), t;
|
|
4386
|
+
}).catch(() => (g(null), v("guest"), null)), [b, n]), S = r(() => b("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
4387
|
+
g(null), v("guest");
|
|
4388
|
+
}), [b]), C = r(() => {
|
|
4389
|
+
y.current || n || t || (y.current = !0, v("loading"), x());
|
|
3710
4390
|
}, [
|
|
3711
4391
|
n,
|
|
3712
4392
|
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
4393
|
x
|
|
4394
|
+
]), w = s(() => ({
|
|
4395
|
+
user: h,
|
|
4396
|
+
status: _,
|
|
4397
|
+
ensure: C,
|
|
4398
|
+
refresh: x,
|
|
4399
|
+
signOut: S
|
|
4400
|
+
}), [
|
|
4401
|
+
h,
|
|
4402
|
+
_,
|
|
4403
|
+
C,
|
|
4404
|
+
x,
|
|
4405
|
+
S
|
|
3726
4406
|
]);
|
|
3727
|
-
return
|
|
3728
|
-
|
|
4407
|
+
return a(() => {
|
|
4408
|
+
n || typeof window > "u" || (window.webim = {
|
|
4409
|
+
...window.webim,
|
|
4410
|
+
user: h,
|
|
4411
|
+
status: _,
|
|
4412
|
+
requireUser: () => y.current || t ? Promise.resolve(h) : x(),
|
|
4413
|
+
signOut: S
|
|
4414
|
+
}, window.dispatchEvent(new CustomEvent("webim:session", { detail: {
|
|
4415
|
+
user: h,
|
|
4416
|
+
status: _
|
|
4417
|
+
} })));
|
|
4418
|
+
}, [
|
|
4419
|
+
n,
|
|
4420
|
+
h,
|
|
4421
|
+
_,
|
|
4422
|
+
t,
|
|
4423
|
+
x,
|
|
4424
|
+
S
|
|
4425
|
+
]), /* @__PURE__ */ d(En.Provider, {
|
|
4426
|
+
value: w,
|
|
3729
4427
|
children: e
|
|
3730
4428
|
});
|
|
3731
4429
|
}
|
|
3732
|
-
function
|
|
3733
|
-
let { status: n } =
|
|
4430
|
+
function kn({ when: e, children: t }) {
|
|
4431
|
+
let { status: n } = Dn();
|
|
3734
4432
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
3735
4433
|
}
|
|
3736
4434
|
//#endregion
|
|
3737
4435
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
3738
|
-
function
|
|
3739
|
-
let { tenant: h, apiUrl: g, settings: _ } = i(
|
|
4436
|
+
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 }) {
|
|
4437
|
+
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
4438
|
if (e.preventDefault(), u) return;
|
|
3741
4439
|
let n = new FormData(e.currentTarget);
|
|
3742
4440
|
C(!0), x("");
|
|
@@ -3772,11 +4470,11 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3772
4470
|
display: "grid",
|
|
3773
4471
|
gap: 12,
|
|
3774
4472
|
maxWidth: 360,
|
|
3775
|
-
...
|
|
4473
|
+
...P(s)
|
|
3776
4474
|
},
|
|
3777
4475
|
children: [
|
|
3778
4476
|
/* @__PURE__ */ f("form", {
|
|
3779
|
-
onSubmit:
|
|
4477
|
+
onSubmit: D,
|
|
3780
4478
|
style: {
|
|
3781
4479
|
display: T === "form" ? "grid" : "none",
|
|
3782
4480
|
gap: 10
|
|
@@ -3784,20 +4482,20 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3784
4482
|
children: [
|
|
3785
4483
|
w ? /* @__PURE__ */ f("label", {
|
|
3786
4484
|
style: {
|
|
3787
|
-
...
|
|
4485
|
+
...Z,
|
|
3788
4486
|
display: "grid",
|
|
3789
4487
|
gap: 6
|
|
3790
4488
|
},
|
|
3791
4489
|
children: [a, /* @__PURE__ */ d("input", {
|
|
3792
4490
|
name: "name",
|
|
3793
4491
|
type: "text",
|
|
3794
|
-
style:
|
|
3795
|
-
|
|
4492
|
+
style: Q,
|
|
4493
|
+
...$(u)
|
|
3796
4494
|
})]
|
|
3797
4495
|
}) : null,
|
|
3798
4496
|
/* @__PURE__ */ f("label", {
|
|
3799
4497
|
style: {
|
|
3800
|
-
...
|
|
4498
|
+
...Z,
|
|
3801
4499
|
display: "grid",
|
|
3802
4500
|
gap: 6
|
|
3803
4501
|
},
|
|
@@ -3805,13 +4503,13 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3805
4503
|
name: "email",
|
|
3806
4504
|
type: "email",
|
|
3807
4505
|
required: !u,
|
|
3808
|
-
style:
|
|
3809
|
-
|
|
4506
|
+
style: Q,
|
|
4507
|
+
...$(u)
|
|
3810
4508
|
})]
|
|
3811
4509
|
}),
|
|
3812
4510
|
/* @__PURE__ */ f("label", {
|
|
3813
4511
|
style: {
|
|
3814
|
-
...
|
|
4512
|
+
...Z,
|
|
3815
4513
|
display: "grid",
|
|
3816
4514
|
gap: 6
|
|
3817
4515
|
},
|
|
@@ -3819,15 +4517,15 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3819
4517
|
name: "password",
|
|
3820
4518
|
type: "password",
|
|
3821
4519
|
required: !u,
|
|
3822
|
-
style:
|
|
3823
|
-
|
|
4520
|
+
style: Q,
|
|
4521
|
+
...$(u)
|
|
3824
4522
|
})]
|
|
3825
4523
|
}),
|
|
3826
4524
|
/* @__PURE__ */ d("button", {
|
|
3827
4525
|
type: u ? "button" : "submit",
|
|
3828
4526
|
disabled: S || void 0,
|
|
3829
4527
|
style: {
|
|
3830
|
-
...
|
|
4528
|
+
...Y,
|
|
3831
4529
|
border: 0,
|
|
3832
4530
|
padding: "10px 22px",
|
|
3833
4531
|
borderRadius: 8,
|
|
@@ -3859,8 +4557,8 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3859
4557
|
]
|
|
3860
4558
|
});
|
|
3861
4559
|
}
|
|
3862
|
-
function
|
|
3863
|
-
let { user: c, status: l, signOut: u } =
|
|
4560
|
+
function jn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
4561
|
+
let { user: c, status: l, signOut: u } = Dn(), p = a ? s || "user" : l, m = a ? {
|
|
3864
4562
|
name: "Ada Lovelace",
|
|
3865
4563
|
email: "ada@example.com"
|
|
3866
4564
|
} : c;
|
|
@@ -3868,7 +4566,7 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3868
4566
|
ref: i,
|
|
3869
4567
|
style: {
|
|
3870
4568
|
minHeight: 24,
|
|
3871
|
-
...
|
|
4569
|
+
...P(r)
|
|
3872
4570
|
}
|
|
3873
4571
|
}) : p === "user" ? /* @__PURE__ */ f("div", {
|
|
3874
4572
|
ref: i,
|
|
@@ -3876,12 +4574,12 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3876
4574
|
display: "flex",
|
|
3877
4575
|
alignItems: "center",
|
|
3878
4576
|
gap: 10,
|
|
3879
|
-
...
|
|
4577
|
+
...P(r)
|
|
3880
4578
|
},
|
|
3881
4579
|
children: [
|
|
3882
4580
|
/* @__PURE__ */ f("span", {
|
|
3883
4581
|
style: {
|
|
3884
|
-
...
|
|
4582
|
+
...Z,
|
|
3885
4583
|
fontWeight: 600
|
|
3886
4584
|
},
|
|
3887
4585
|
children: [
|
|
@@ -3892,7 +4590,7 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3892
4590
|
}),
|
|
3893
4591
|
n && m?.email ? /* @__PURE__ */ d("span", {
|
|
3894
4592
|
style: {
|
|
3895
|
-
...
|
|
4593
|
+
...Z,
|
|
3896
4594
|
opacity: .7
|
|
3897
4595
|
},
|
|
3898
4596
|
children: m.email
|
|
@@ -3901,14 +4599,14 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3901
4599
|
type: "button",
|
|
3902
4600
|
onClick: a ? void 0 : u,
|
|
3903
4601
|
style: {
|
|
3904
|
-
...
|
|
4602
|
+
...Y,
|
|
3905
4603
|
border: 0,
|
|
3906
4604
|
padding: "8px 16px",
|
|
3907
4605
|
borderRadius: 8,
|
|
3908
4606
|
fontSize: 14,
|
|
3909
4607
|
cursor: a ? "default" : "pointer"
|
|
3910
4608
|
},
|
|
3911
|
-
|
|
4609
|
+
...$(a),
|
|
3912
4610
|
children: t
|
|
3913
4611
|
})
|
|
3914
4612
|
]
|
|
@@ -3918,47 +4616,47 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3918
4616
|
display: "flex",
|
|
3919
4617
|
alignItems: "center",
|
|
3920
4618
|
gap: 10,
|
|
3921
|
-
...
|
|
4619
|
+
...P(r)
|
|
3922
4620
|
},
|
|
3923
4621
|
children: o?.signedOut ?? null
|
|
3924
4622
|
});
|
|
3925
4623
|
}
|
|
3926
4624
|
//#endregion
|
|
3927
4625
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
3928
|
-
var
|
|
4626
|
+
var Mn = {
|
|
3929
4627
|
id: "consent",
|
|
3930
4628
|
label: "Cookie consent",
|
|
3931
4629
|
category: "Apps",
|
|
3932
4630
|
keys: ["CookieConsent"],
|
|
3933
4631
|
ssr: "shell",
|
|
3934
4632
|
settings: []
|
|
3935
|
-
},
|
|
3936
|
-
function
|
|
4633
|
+
}, Nn = "webim.cookie_consent";
|
|
4634
|
+
function Pn() {
|
|
3937
4635
|
try {
|
|
3938
|
-
let e = window.localStorage.getItem(
|
|
4636
|
+
let e = window.localStorage.getItem(Nn), t = e ? JSON.parse(e) : null;
|
|
3939
4637
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
3940
4638
|
} catch {
|
|
3941
4639
|
return "";
|
|
3942
4640
|
}
|
|
3943
4641
|
}
|
|
3944
|
-
function
|
|
4642
|
+
function Fn(e) {
|
|
3945
4643
|
try {
|
|
3946
4644
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
3947
4645
|
} catch {}
|
|
3948
4646
|
}
|
|
3949
|
-
function
|
|
4647
|
+
function In(e) {
|
|
3950
4648
|
try {
|
|
3951
|
-
window.localStorage.setItem(
|
|
4649
|
+
window.localStorage.setItem(Nn, JSON.stringify({
|
|
3952
4650
|
choice: e,
|
|
3953
4651
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3954
4652
|
}));
|
|
3955
4653
|
} catch {}
|
|
3956
|
-
|
|
4654
|
+
Fn(e);
|
|
3957
4655
|
try {
|
|
3958
4656
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
3959
4657
|
} catch {}
|
|
3960
4658
|
}
|
|
3961
|
-
var
|
|
4659
|
+
var Ln = {
|
|
3962
4660
|
bottom: {
|
|
3963
4661
|
left: 0,
|
|
3964
4662
|
right: 0,
|
|
@@ -3980,21 +4678,21 @@ var hn = {
|
|
|
3980
4678
|
maxWidth: 400
|
|
3981
4679
|
}
|
|
3982
4680
|
};
|
|
3983
|
-
function
|
|
4681
|
+
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
4682
|
let [g, _] = l(!!h), [v, y] = l(null), b = (e) => {
|
|
3985
4683
|
y(e), typeof m == "function" && m(e);
|
|
3986
4684
|
};
|
|
3987
4685
|
if (a(() => {
|
|
3988
4686
|
if (h) return;
|
|
3989
|
-
let e =
|
|
4687
|
+
let e = Pn();
|
|
3990
4688
|
if (e) {
|
|
3991
4689
|
let t = v?.closest?.(".webim-page");
|
|
3992
4690
|
t && t.setAttribute("data-webim-consent", e);
|
|
3993
4691
|
} else _(!0);
|
|
3994
4692
|
}, [h, v]), !g) return null;
|
|
3995
4693
|
let x = (e) => () => {
|
|
3996
|
-
h || (
|
|
3997
|
-
}, S =
|
|
4694
|
+
h || (In(e, v), _(!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)])) : 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, 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 };
|