webim-adapter 2.0.1 → 2.0.2
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/CHANGELOG.md +7 -0
- package/build/webim-adapter.js +386 -284
- package/build/webim-embed.js +6 -6
- package/build/webim-ssr.js +306 -204
- package/package.json +9 -10
package/build/webim-adapter.js
CHANGED
|
@@ -254,21 +254,21 @@ function A(e) {
|
|
|
254
254
|
R !== void 0 && U.push(`blur(${O(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(" "));
|
|
255
255
|
let ee = F(L);
|
|
256
256
|
ee.length && (t.backdropFilter = ee.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
257
|
-
let { textStrokeWidth:
|
|
258
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
259
|
-
let { clipText:
|
|
260
|
-
delete t.clipText,
|
|
261
|
-
let { transitions:
|
|
257
|
+
let { textStrokeWidth: te, textStrokeColor: ne } = t;
|
|
258
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (te !== void 0 || ne !== void 0) && (t.WebkitTextStroke = `${O(te ?? 1)} ${ne || "currentColor"}`);
|
|
259
|
+
let { clipText: re } = t;
|
|
260
|
+
delete t.clipText, re && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
261
|
+
let { transitions: ie, transitionDuration: W, transitionEasing: G, transitionProperty: K } = t, ae = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
262
262
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
263
|
-
let
|
|
264
|
-
if (
|
|
263
|
+
let q = (Array.isArray(ie) ? ie : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ae(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
264
|
+
if (W !== void 0 && q.push(`${K || "all"} ${ae(W)} ${G || "ease"}`), q.length && (t.transition = q.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
265
265
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
266
266
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
267
267
|
}
|
|
268
268
|
delete t.backgroundVideo;
|
|
269
|
-
let { overlayColor:
|
|
270
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
271
|
-
let e = `color-mix(in srgb, ${
|
|
269
|
+
let { overlayColor: J, overlayOpacity: oe } = t;
|
|
270
|
+
if (delete t.overlayColor, delete t.overlayOpacity, J) {
|
|
271
|
+
let e = `color-mix(in srgb, ${J} ${oe ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
272
272
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
273
273
|
}
|
|
274
274
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
@@ -377,7 +377,7 @@ function U(e, t, n, r = !1) {
|
|
|
377
377
|
function ee(e, t, n) {
|
|
378
378
|
return Object.entries(j).map(([r, i]) => U(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
379
379
|
}
|
|
380
|
-
var
|
|
380
|
+
var te = [
|
|
381
381
|
{
|
|
382
382
|
key: "tablet",
|
|
383
383
|
max: 991
|
|
@@ -390,17 +390,17 @@ var W = [
|
|
|
390
390
|
key: "mobile",
|
|
391
391
|
max: 478
|
|
392
392
|
}
|
|
393
|
-
],
|
|
394
|
-
function
|
|
395
|
-
return
|
|
396
|
-
let i = t?.[n] ?
|
|
393
|
+
], ne = (e) => Object.entries(A(e)).map(([e, t]) => `${H(e)}: ${t} !important;`).join(" ");
|
|
394
|
+
function re(e, t) {
|
|
395
|
+
return te.map(({ key: n, max: r }) => {
|
|
396
|
+
let i = t?.[n] ? ne(t[n]) : "";
|
|
397
397
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
398
398
|
}).filter(Boolean).join("\n");
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function ie(e, t) {
|
|
401
401
|
let n = [], r = (e) => {
|
|
402
402
|
for (let [t, r] of Object.entries(e || {})) {
|
|
403
|
-
let e =
|
|
403
|
+
let e = re(t, r.props);
|
|
404
404
|
e && n.push(e);
|
|
405
405
|
}
|
|
406
406
|
};
|
|
@@ -408,7 +408,7 @@ function re(e, t) {
|
|
|
408
408
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
409
409
|
return n.join("\n");
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function W(e, t) {
|
|
412
412
|
let n = [], r = (e) => {
|
|
413
413
|
for (let [t, r] of Object.entries(e || {})) {
|
|
414
414
|
let e = ee(t, r.props);
|
|
@@ -419,15 +419,15 @@ function G(e, t) {
|
|
|
419
419
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
420
420
|
return n.join("\n");
|
|
421
421
|
}
|
|
422
|
-
var
|
|
423
|
-
fontFamily:
|
|
422
|
+
var G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", K = {
|
|
423
|
+
fontFamily: G,
|
|
424
424
|
fontStyle: "normal",
|
|
425
425
|
fontWeight: 400,
|
|
426
426
|
letterSpacing: "normal",
|
|
427
427
|
textTransform: "none",
|
|
428
428
|
lineHeight: 1.4,
|
|
429
429
|
textShadow: "none"
|
|
430
|
-
},
|
|
430
|
+
}, ae = {
|
|
431
431
|
light: {
|
|
432
432
|
background: "#f2f2f2",
|
|
433
433
|
surface: "#f2f2f2",
|
|
@@ -468,32 +468,32 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
468
468
|
contrastText: "#052e2b"
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
},
|
|
471
|
+
}, q = {
|
|
472
472
|
h1: 40,
|
|
473
473
|
h2: 32,
|
|
474
474
|
h3: 26,
|
|
475
475
|
h4: 22,
|
|
476
476
|
h5: 19,
|
|
477
477
|
h6: 16
|
|
478
|
-
},
|
|
478
|
+
}, J = {
|
|
479
479
|
font: "system",
|
|
480
480
|
headingFont: "inherit",
|
|
481
|
-
headings:
|
|
481
|
+
headings: q,
|
|
482
482
|
bodySize: 16,
|
|
483
|
-
light:
|
|
484
|
-
dark:
|
|
483
|
+
light: ae.light,
|
|
484
|
+
dark: ae.dark
|
|
485
485
|
}, oe = {
|
|
486
486
|
system: {
|
|
487
487
|
label: "System",
|
|
488
|
-
value:
|
|
488
|
+
value: G
|
|
489
489
|
},
|
|
490
490
|
inter: {
|
|
491
491
|
label: "Inter",
|
|
492
|
-
value: `"Inter", ${
|
|
492
|
+
value: `"Inter", ${G}`
|
|
493
493
|
},
|
|
494
494
|
outfit: {
|
|
495
495
|
label: "Outfit",
|
|
496
|
-
value: `"Outfit", ${
|
|
496
|
+
value: `"Outfit", ${G}`
|
|
497
497
|
},
|
|
498
498
|
serif: {
|
|
499
499
|
label: "Serif",
|
|
@@ -522,22 +522,22 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
522
522
|
function le(e) {
|
|
523
523
|
let { light: t, dark: n, font: r, headingFont: i, headings: a, bodySize: o, ...s } = e ?? {};
|
|
524
524
|
return {
|
|
525
|
-
font: r ??
|
|
526
|
-
headingFont: i ??
|
|
525
|
+
font: r ?? J.font,
|
|
526
|
+
headingFont: i ?? J.headingFont,
|
|
527
527
|
headings: {
|
|
528
|
-
...
|
|
528
|
+
...q,
|
|
529
529
|
...a ?? {}
|
|
530
530
|
},
|
|
531
531
|
bodySize: o ?? 16,
|
|
532
|
-
light: ce(
|
|
533
|
-
dark: ce(
|
|
532
|
+
light: ce(ae.light, s, t),
|
|
533
|
+
dark: ce(ae.dark, n)
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
536
|
function ue(e) {
|
|
537
537
|
return {
|
|
538
538
|
"--page-bg": e.background,
|
|
539
539
|
"--page-surface": e.surface ?? e.background,
|
|
540
|
-
"--page-border": e.border ??
|
|
540
|
+
"--page-border": e.border ?? ae.light.border,
|
|
541
541
|
"--page-text": e.text,
|
|
542
542
|
"--page-accent": e.accent,
|
|
543
543
|
"--page-accent-text": e.accentText,
|
|
@@ -556,7 +556,7 @@ function de(e) {
|
|
|
556
556
|
return {
|
|
557
557
|
backgroundColor: "var(--page-bg)",
|
|
558
558
|
color: "var(--page-text)",
|
|
559
|
-
fontFamily: se(t.font,
|
|
559
|
+
fontFamily: se(t.font, G),
|
|
560
560
|
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : se(t.headingFont, "inherit"),
|
|
561
561
|
...pe(t.headings),
|
|
562
562
|
"--page-body-size": fe(t.bodySize, 16)
|
|
@@ -567,9 +567,9 @@ function fe(e, t) {
|
|
|
567
567
|
}
|
|
568
568
|
function pe(e) {
|
|
569
569
|
let t = {};
|
|
570
|
-
for (let n of Object.keys(
|
|
571
|
-
let r = e?.[n] ??
|
|
572
|
-
t[`--page-${n}`] = fe(r,
|
|
570
|
+
for (let n of Object.keys(q)) {
|
|
571
|
+
let r = e?.[n] ?? q[n];
|
|
572
|
+
t[`--page-${n}`] = fe(r, q[n]);
|
|
573
573
|
}
|
|
574
574
|
return t;
|
|
575
575
|
}
|
|
@@ -716,7 +716,7 @@ var Ae = {
|
|
|
716
716
|
fontWeight: 700,
|
|
717
717
|
lineHeight: 1.2,
|
|
718
718
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
719
|
-
}, je =
|
|
719
|
+
}, je = q, Me = (e) => `var(--page-${e}, ${q[e] ?? q.h2}px)`, Ne = {
|
|
720
720
|
margin: 0,
|
|
721
721
|
fontSize: "var(--page-body-size, 16px)"
|
|
722
722
|
}, Pe = {
|
|
@@ -4454,32 +4454,32 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4454
4454
|
};
|
|
4455
4455
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4456
4456
|
}, [P, L]);
|
|
4457
|
-
let { tenant: H, apiUrl: U } = r(Z), ee = r(xe),
|
|
4457
|
+
let { tenant: H, apiUrl: U } = r(Z), ee = r(xe), te = ee?.[h], ne = C ? Se(ee) : 1, [re, ie] = c(null);
|
|
4458
4458
|
if (i(() => {
|
|
4459
|
-
if (!h ||
|
|
4460
|
-
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(
|
|
4459
|
+
if (!h || te) return;
|
|
4460
|
+
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(ne - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${U}/data/${encodeURIComponent(h.slice(4))}` : `${U}/dynamic/${encodeURIComponent(h)}${n}`;
|
|
4461
4461
|
return fetch(r, { headers: H ? { "x-tenant": H } : {} }).then((e) => e.json()).then((t) => {
|
|
4462
4462
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4463
|
-
return e &&
|
|
4464
|
-
}).catch(() => e &&
|
|
4463
|
+
return e && ie(n);
|
|
4464
|
+
}).catch(() => e && ie([])), () => {
|
|
4465
4465
|
e = !1;
|
|
4466
4466
|
};
|
|
4467
4467
|
}, [
|
|
4468
4468
|
h,
|
|
4469
4469
|
H,
|
|
4470
4470
|
U,
|
|
4471
|
-
W,
|
|
4472
|
-
C,
|
|
4473
4471
|
te,
|
|
4472
|
+
C,
|
|
4473
|
+
ne,
|
|
4474
4474
|
g
|
|
4475
4475
|
]), !e.length) return null;
|
|
4476
|
-
let
|
|
4476
|
+
let W = Math.max(1, Number(g) || 10), G = h ? C ? te || h.startsWith("api:") ? (te ?? re ?? []).slice((ne - 1) * W, ne * W) : (re ?? []).slice(0, W) : (te ?? re ?? []).slice(0, W) : null, K = G ? G.map((t) => e.map((e) => Oe(Ee(t?.data, e.field)))) : t, ae = !!h && !(h && !te && re === null) && K.length === 0, q = b ? {
|
|
4477
4477
|
y: 6,
|
|
4478
4478
|
x: 10
|
|
4479
4479
|
} : {
|
|
4480
4480
|
y: 10,
|
|
4481
4481
|
x: 14
|
|
4482
|
-
},
|
|
4482
|
+
}, J = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : q.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : q.x}px`, oe = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, se = y ? { border: oe } : { borderBottom: oe }, ce = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), le = [
|
|
4483
4483
|
"left",
|
|
4484
4484
|
"center",
|
|
4485
4485
|
"right"
|
|
@@ -4499,7 +4499,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4499
4499
|
};
|
|
4500
4500
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4501
4501
|
}, ye = /* @__PURE__ */ new Set();
|
|
4502
|
-
p &&
|
|
4502
|
+
p && K.forEach((t, n) => e.forEach((e, t) => {
|
|
4503
4503
|
let r = p[Hn(a[n], o[t])];
|
|
4504
4504
|
if (!r) return;
|
|
4505
4505
|
let i = Math.max(1, Number(r.c) || 1), s = Math.max(1, Number(r.r) || 1);
|
|
@@ -4523,7 +4523,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4523
4523
|
},
|
|
4524
4524
|
onClick: n,
|
|
4525
4525
|
children: e
|
|
4526
|
-
}, t), X = L && L.r <
|
|
4526
|
+
}, t), X = L && L.r < K.length && L.c < e.length ? L : null, Q = (e, t) => P?.labels?.[e] ?? t, Ce = X ? p?.[Hn(a[X.r], o[X.c])] : null, we = Math.max(1, Number(Ce?.c) || 1), Te = Math.max(1, Number(Ce?.r) || 1);
|
|
4527
4527
|
return /* @__PURE__ */ d("div", {
|
|
4528
4528
|
ref: (e) => {
|
|
4529
4529
|
I.current = e, typeof N == "function" && N(e);
|
|
@@ -4550,8 +4550,8 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4550
4550
|
Y("+↑", Q("rowAbove", "Insert row above"), () => P.addRow(X.r - 1)),
|
|
4551
4551
|
Y("+↓", Q("rowBelow", "Insert row below"), () => P.addRow(X.r)),
|
|
4552
4552
|
Y("↑", Q("rowUp", "Move row up"), () => P.moveRow(X.r, -1), X.r === 0),
|
|
4553
|
-
Y("↓", Q("rowDown", "Move row down"), () => P.moveRow(X.r, 1), X.r >=
|
|
4554
|
-
Y("✕ row", Q("rowDelete", "Delete row"), () => P.dropRow(X.r),
|
|
4553
|
+
Y("↓", Q("rowDown", "Move row down"), () => P.moveRow(X.r, 1), X.r >= K.length - 1),
|
|
4554
|
+
Y("✕ row", Q("rowDelete", "Delete row"), () => P.dropRow(X.r), K.length <= 1),
|
|
4555
4555
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4556
4556
|
Y("+←", Q("colLeft", "Insert column left"), () => P.addColumn(X.c - 1)),
|
|
4557
4557
|
Y("+→", Q("colRight", "Insert column right"), () => P.addColumn(X.c)),
|
|
@@ -4560,7 +4560,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4560
4560
|
Y("✕ col", Q("colDelete", "Delete column"), () => P.dropColumn(X.c), e.length <= 1),
|
|
4561
4561
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4562
4562
|
Y("↔", Q("mergeRight", "Merge with the cell on the right"), () => P.merge(X.r, X.c, "right"), X.c + we >= e.length),
|
|
4563
|
-
Y("↕", Q("mergeDown", "Merge with the cell below"), () => P.merge(X.r, X.c, "down"), X.r + Te >=
|
|
4563
|
+
Y("↕", Q("mergeDown", "Merge with the cell below"), () => P.merge(X.r, X.c, "down"), X.r + Te >= K.length),
|
|
4564
4564
|
Y("⤫", Q("split", "Split this cell"), () => P.split(X.r, X.c), we === 1 && Te === 1)
|
|
4565
4565
|
]
|
|
4566
4566
|
}),
|
|
@@ -4590,7 +4590,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4590
4590
|
style: {
|
|
4591
4591
|
textAlign: de(n),
|
|
4592
4592
|
fontWeight: 600,
|
|
4593
|
-
padding:
|
|
4593
|
+
padding: J,
|
|
4594
4594
|
...typeof D == "string" && D ? { color: D } : null,
|
|
4595
4595
|
background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
|
|
4596
4596
|
...T ? {
|
|
@@ -4611,16 +4611,16 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4611
4611
|
onPointerDown: ve(n)
|
|
4612
4612
|
})] }) : t.label ?? t
|
|
4613
4613
|
}, n)) }) }),
|
|
4614
|
-
/* @__PURE__ */ d("tbody", { children: [
|
|
4614
|
+
/* @__PURE__ */ d("tbody", { children: [ae && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
4615
4615
|
colSpan: e.length,
|
|
4616
4616
|
style: {
|
|
4617
|
-
padding:
|
|
4617
|
+
padding: J,
|
|
4618
4618
|
textAlign: "center",
|
|
4619
4619
|
opacity: .6,
|
|
4620
4620
|
...se
|
|
4621
4621
|
},
|
|
4622
4622
|
children: w || "No data yet"
|
|
4623
|
-
}) }),
|
|
4623
|
+
}) }), K.map((t, n) => /* @__PURE__ */ u("tr", {
|
|
4624
4624
|
className: P ? "wb-tedit-row" : void 0,
|
|
4625
4625
|
style: {
|
|
4626
4626
|
...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
|
|
@@ -4636,7 +4636,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4636
4636
|
colSpan: l > 1 ? l : void 0,
|
|
4637
4637
|
rowSpan: f > 1 ? f : void 0,
|
|
4638
4638
|
style: {
|
|
4639
|
-
padding:
|
|
4639
|
+
padding: J,
|
|
4640
4640
|
...ue(r) ? { textAlign: ue(r) } : null,
|
|
4641
4641
|
...P ? { position: "relative" } : null,
|
|
4642
4642
|
...se
|
|
@@ -4802,7 +4802,7 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4802
4802
|
year: n.getFullYear(),
|
|
4803
4803
|
month: n.getMonth()
|
|
4804
4804
|
};
|
|
4805
|
-
}),
|
|
4805
|
+
}), te = (e, t) => /* @__PURE__ */ u("button", {
|
|
4806
4806
|
type: "button",
|
|
4807
4807
|
"aria-label": e,
|
|
4808
4808
|
onClick: () => ee(t),
|
|
@@ -4817,7 +4817,7 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4817
4817
|
padding: "4px 8px"
|
|
4818
4818
|
},
|
|
4819
4819
|
children: t < 0 ? "‹" : "›"
|
|
4820
|
-
}),
|
|
4820
|
+
}), ne = /* @__PURE__ */ d("div", {
|
|
4821
4821
|
style: {
|
|
4822
4822
|
display: "flex",
|
|
4823
4823
|
alignItems: "center",
|
|
@@ -4834,8 +4834,8 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4834
4834
|
},
|
|
4835
4835
|
children: U
|
|
4836
4836
|
}),
|
|
4837
|
-
|
|
4838
|
-
|
|
4837
|
+
te("Previous month", -1),
|
|
4838
|
+
te("Next month", 1)
|
|
4839
4839
|
]
|
|
4840
4840
|
});
|
|
4841
4841
|
if (p === "list") {
|
|
@@ -4851,7 +4851,7 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4851
4851
|
width: "100%",
|
|
4852
4852
|
...A(S)
|
|
4853
4853
|
},
|
|
4854
|
-
children: [
|
|
4854
|
+
children: [ne, e.length ? /* @__PURE__ */ u("div", {
|
|
4855
4855
|
style: {
|
|
4856
4856
|
display: "flex",
|
|
4857
4857
|
flexDirection: "column",
|
|
@@ -4887,10 +4887,10 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4887
4887
|
})]
|
|
4888
4888
|
});
|
|
4889
4889
|
}
|
|
4890
|
-
let
|
|
4891
|
-
for (let e = 0; e <
|
|
4892
|
-
let t = e -
|
|
4893
|
-
|
|
4890
|
+
let re = new Date(M.year, M.month, 1), ie = y === "sunday" ? 0 : 1, W = (re.getDay() - ie + 7) % 7, G = new Date(M.year, M.month + 1, 0).getDate(), K = Math.ceil((W + G) / 7), ae = Kn(/* @__PURE__ */ new Date()), q = new Intl.DateTimeFormat(V, { weekday: "short" }), J = [];
|
|
4891
|
+
for (let e = 0; e < K * 7; e += 1) {
|
|
4892
|
+
let t = e - W + 1, n = t >= 1 && t <= G, r = Kn(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ae;
|
|
4893
|
+
J.push(/* @__PURE__ */ d("div", {
|
|
4894
4894
|
style: {
|
|
4895
4895
|
minHeight: P.cell,
|
|
4896
4896
|
borderTop: `1px solid ${I}`,
|
|
@@ -4933,7 +4933,7 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4933
4933
|
...A(S)
|
|
4934
4934
|
},
|
|
4935
4935
|
children: [
|
|
4936
|
-
|
|
4936
|
+
ne,
|
|
4937
4937
|
/* @__PURE__ */ d("div", {
|
|
4938
4938
|
style: {
|
|
4939
4939
|
display: "grid",
|
|
@@ -4947,8 +4947,8 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4947
4947
|
textAlign: "center",
|
|
4948
4948
|
padding: `0 0 ${P.pad}px`
|
|
4949
4949
|
},
|
|
4950
|
-
children:
|
|
4951
|
-
}, `head-${t}`)),
|
|
4950
|
+
children: q.format(new Date(2024, 0, 7 + ie + t))
|
|
4951
|
+
}, `head-${t}`)), J]
|
|
4952
4952
|
}),
|
|
4953
4953
|
/* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4954
4954
|
]
|
|
@@ -4971,7 +4971,7 @@ function er(e, t = {}) {
|
|
|
4971
4971
|
}).filter((e) => e.src);
|
|
4972
4972
|
}
|
|
4973
4973
|
function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a = "", hrefField: o = "", variant: f = "step", size: p = "medium", perView: m = 5, gap: h = 48, hold: g = 3, slideMs: _ = 500, direction: v = "left", arrows: y = "show", pauseOnHover: b = !0, grayscale: x = !0, newTab: S = !0, emptyText: C = "", style: w, nodeRef: T, inert: E }) {
|
|
4974
|
-
let { tenant: D, apiUrl: O } = r(Z), k = r(xe)?.[t], [j, M] = c(null), N = s(null), P = s(null), [F, I] = c(0), [L, R] = c(0), [z, B] = c(0), [V, H] = c(!0), [U, ee] = c(!1), [
|
|
4974
|
+
let { tenant: D, apiUrl: O } = r(Z), k = r(xe)?.[t], [j, M] = c(null), N = s(null), P = s(null), [F, I] = c(0), [L, R] = c(0), [z, B] = c(0), [V, H] = c(!0), [U, ee] = c(!1), [te, ne] = c(!1);
|
|
4975
4975
|
i(() => {
|
|
4976
4976
|
if (!t || k) return;
|
|
4977
4977
|
let e = !0;
|
|
@@ -4988,7 +4988,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
4988
4988
|
k
|
|
4989
4989
|
]), i(() => {
|
|
4990
4990
|
if (typeof window > "u" || !window.matchMedia) return;
|
|
4991
|
-
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () =>
|
|
4991
|
+
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => ne(e.matches);
|
|
4992
4992
|
return t(), e.addEventListener?.("change", t), () => e.removeEventListener?.("change", t);
|
|
4993
4993
|
}, []), i(() => {
|
|
4994
4994
|
let e = P.current;
|
|
@@ -5001,7 +5001,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5001
5001
|
let e = N.current;
|
|
5002
5002
|
if (!e) return;
|
|
5003
5003
|
let t = !0, n = () => {
|
|
5004
|
-
let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight *
|
|
5004
|
+
let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight * W);
|
|
5005
5005
|
t && n.length && R(Math.ceil(Math.max(...n)));
|
|
5006
5006
|
};
|
|
5007
5007
|
n();
|
|
@@ -5010,12 +5010,12 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5010
5010
|
t = !1, r.forEach((e) => e.removeEventListener("load", n));
|
|
5011
5011
|
};
|
|
5012
5012
|
});
|
|
5013
|
-
let
|
|
5013
|
+
let re = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], ie = t ? er(k ?? j ?? [], {
|
|
5014
5014
|
imageField: n,
|
|
5015
5015
|
nameField: a,
|
|
5016
5016
|
hrefField: o
|
|
5017
|
-
}) :
|
|
5018
|
-
if (!
|
|
5017
|
+
}) : re, W = $n[p] ?? $n.medium, G = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, ae = f === "marquee" ? "step" : f, q = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), J = Math.min(3e3, Math.max(100, Number(_) || 500)), oe = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), se = (L || W * 3) + G, ce = F ? Math.max(1, Math.floor(F / se)) : oe, le = Math.min(oe, ce), ue = F ? Math.min(se, F / le) : se;
|
|
5018
|
+
if (!ie.length) return /* @__PURE__ */ u("div", {
|
|
5019
5019
|
ref: T,
|
|
5020
5020
|
style: {
|
|
5021
5021
|
width: "100%",
|
|
@@ -5027,7 +5027,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5027
5027
|
alignItems: "center",
|
|
5028
5028
|
justifyContent: "center",
|
|
5029
5029
|
flexWrap: "wrap",
|
|
5030
|
-
gap:
|
|
5030
|
+
gap: G
|
|
5031
5031
|
},
|
|
5032
5032
|
children: [
|
|
5033
5033
|
0,
|
|
@@ -5037,16 +5037,16 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5037
5037
|
4
|
|
5038
5038
|
].map((e) => /* @__PURE__ */ u("div", {
|
|
5039
5039
|
style: {
|
|
5040
|
-
height:
|
|
5041
|
-
width:
|
|
5040
|
+
height: W,
|
|
5041
|
+
width: W * 3,
|
|
5042
5042
|
border: "1px dashed var(--page-border, rgba(148, 163, 184, 0.5))",
|
|
5043
5043
|
borderRadius: 6,
|
|
5044
5044
|
display: "flex",
|
|
5045
5045
|
alignItems: "center",
|
|
5046
5046
|
justifyContent: "center",
|
|
5047
|
-
fontSize: Math.max(10, Math.round(
|
|
5047
|
+
fontSize: Math.max(10, Math.round(W / 4)),
|
|
5048
5048
|
opacity: .45,
|
|
5049
|
-
...
|
|
5049
|
+
...K
|
|
5050
5050
|
},
|
|
5051
5051
|
children: "LOGO"
|
|
5052
5052
|
}, e))
|
|
@@ -5060,12 +5060,12 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5060
5060
|
children: C
|
|
5061
5061
|
}) : null
|
|
5062
5062
|
});
|
|
5063
|
-
let de =
|
|
5063
|
+
let de = ie.length, fe = ae === "step" && de > le, pe = ae === "slider", me = fe && !E && !U && !te, he = v === "right", ge = he ? de : 0, _e = fe ? [...ie, ...ie] : ie, ve = fe ? z * ue : 0, ye = (e, t, n) => {
|
|
5064
5064
|
let r = /* @__PURE__ */ u("img", {
|
|
5065
5065
|
src: e.src,
|
|
5066
5066
|
alt: e.alt ?? "",
|
|
5067
5067
|
style: {
|
|
5068
|
-
height:
|
|
5068
|
+
height: W,
|
|
5069
5069
|
width: "auto",
|
|
5070
5070
|
maxWidth: "100%",
|
|
5071
5071
|
objectFit: "contain",
|
|
@@ -5074,7 +5074,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5074
5074
|
}), i = fe ? {
|
|
5075
5075
|
width: ue,
|
|
5076
5076
|
flex: "0 0 auto",
|
|
5077
|
-
padding: `0 ${
|
|
5077
|
+
padding: `0 ${G / 2}px`,
|
|
5078
5078
|
justifyContent: "center"
|
|
5079
5079
|
} : {};
|
|
5080
5080
|
return e.href && !E ? /* @__PURE__ */ u("a", {
|
|
@@ -5106,14 +5106,14 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5106
5106
|
...fe ? {
|
|
5107
5107
|
width: _e.length * ue,
|
|
5108
5108
|
transform: `translateX(-${ve}px)`,
|
|
5109
|
-
transition: V ? `transform ${
|
|
5109
|
+
transition: V ? `transform ${J}ms ease` : "none"
|
|
5110
5110
|
} : pe ? {
|
|
5111
|
-
gap:
|
|
5111
|
+
gap: G,
|
|
5112
5112
|
overflowX: "auto",
|
|
5113
5113
|
scrollBehavior: "smooth",
|
|
5114
5114
|
scrollSnapType: "x proximity"
|
|
5115
5115
|
} : {
|
|
5116
|
-
gap:
|
|
5116
|
+
gap: G,
|
|
5117
5117
|
flexWrap: "wrap",
|
|
5118
5118
|
justifyContent: "center"
|
|
5119
5119
|
}
|
|
@@ -5201,8 +5201,8 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5201
5201
|
] }),
|
|
5202
5202
|
/* @__PURE__ */ u(nr, {
|
|
5203
5203
|
running: me,
|
|
5204
|
-
every:
|
|
5205
|
-
slide:
|
|
5204
|
+
every: q + J,
|
|
5205
|
+
slide: J,
|
|
5206
5206
|
step: he ? -1 : 1,
|
|
5207
5207
|
index: z,
|
|
5208
5208
|
total: de,
|
|
@@ -5449,11 +5449,113 @@ function ir({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5449
5449
|
})]
|
|
5450
5450
|
});
|
|
5451
5451
|
}
|
|
5452
|
-
|
|
5452
|
+
function ar({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: a = "left", panelWidth: o = "", offset: l = 8, editorOpen: f = !0, linked: p, style: m, nodeRef: h, inert: g = !1 }) {
|
|
5453
|
+
let [_, v] = c(!1), y = s(null), b = s(null), x = r !== "click", S = () => {
|
|
5454
|
+
b.current && clearTimeout(b.current), b.current = null;
|
|
5455
|
+
}, C = () => {
|
|
5456
|
+
S(), b.current = setTimeout(() => v(!1), 160);
|
|
5457
|
+
};
|
|
5458
|
+
i(() => {
|
|
5459
|
+
if (g || !e) return;
|
|
5460
|
+
let t = `[data-webim-toggle="${e}"]`, n = (e) => {
|
|
5461
|
+
e.target.closest?.(t) && (e.preventDefault(), S(), v((e) => !e));
|
|
5462
|
+
}, r = (e) => {
|
|
5463
|
+
e.target.closest?.(t) && (S(), v(!0));
|
|
5464
|
+
}, i = (e) => {
|
|
5465
|
+
let n = e.target.closest?.(t);
|
|
5466
|
+
!n || e.relatedTarget && n.contains(e.relatedTarget) || C();
|
|
5467
|
+
};
|
|
5468
|
+
return document.addEventListener("click", n), x && (document.addEventListener("mouseover", r), document.addEventListener("mouseout", i)), () => {
|
|
5469
|
+
document.removeEventListener("click", n), document.removeEventListener("mouseover", r), document.removeEventListener("mouseout", i);
|
|
5470
|
+
};
|
|
5471
|
+
}, [
|
|
5472
|
+
g,
|
|
5473
|
+
e,
|
|
5474
|
+
x
|
|
5475
|
+
]), i(() => {
|
|
5476
|
+
if (g || !_) return;
|
|
5477
|
+
let t = (t) => {
|
|
5478
|
+
y.current?.contains(t.target) || e && t.target.closest?.(`[data-webim-toggle="${e}"]`) || v(!1);
|
|
5479
|
+
}, n = (e) => e.key === "Escape" && v(!1);
|
|
5480
|
+
return document.addEventListener("mousedown", t), document.addEventListener("keydown", n), () => {
|
|
5481
|
+
document.removeEventListener("mousedown", t), document.removeEventListener("keydown", n);
|
|
5482
|
+
};
|
|
5483
|
+
}, [
|
|
5484
|
+
g,
|
|
5485
|
+
_,
|
|
5486
|
+
e
|
|
5487
|
+
]), i(() => S, []);
|
|
5488
|
+
let w = Number(o) > 0 ? Number(o) : null, T = g ? f !== !1 : _, E = /* @__PURE__ */ u("div", {
|
|
5489
|
+
style: {
|
|
5490
|
+
position: "absolute",
|
|
5491
|
+
top: `calc(100% + ${Number(l) || 0}px)`,
|
|
5492
|
+
...a === "right" ? { right: 0 } : a === "center" ? {
|
|
5493
|
+
left: "50%",
|
|
5494
|
+
transform: "translateX(-50%)"
|
|
5495
|
+
} : { left: 0 },
|
|
5496
|
+
zIndex: 60,
|
|
5497
|
+
display: T ? "block" : "none",
|
|
5498
|
+
minWidth: w ?? 240,
|
|
5499
|
+
width: w ?? void 0,
|
|
5500
|
+
maxWidth: "92vw",
|
|
5501
|
+
padding: 14,
|
|
5502
|
+
borderRadius: 10,
|
|
5503
|
+
background: "var(--page-surface, #ffffff)",
|
|
5504
|
+
color: "var(--page-text, inherit)",
|
|
5505
|
+
border: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))",
|
|
5506
|
+
boxShadow: "0 16px 44px rgba(15, 23, 42, 0.22)",
|
|
5507
|
+
...A(m)
|
|
5508
|
+
},
|
|
5509
|
+
children: p?.content ?? null
|
|
5510
|
+
});
|
|
5511
|
+
return /* @__PURE__ */ d("div", {
|
|
5512
|
+
ref: (e) => {
|
|
5513
|
+
y.current = e, h && h(e);
|
|
5514
|
+
},
|
|
5515
|
+
id: e || void 0,
|
|
5516
|
+
onMouseEnter: !g && x ? () => {
|
|
5517
|
+
S(), v(!0);
|
|
5518
|
+
} : void 0,
|
|
5519
|
+
onMouseLeave: !g && x ? C : void 0,
|
|
5520
|
+
style: {
|
|
5521
|
+
position: "relative",
|
|
5522
|
+
display: "inline-block"
|
|
5523
|
+
},
|
|
5524
|
+
children: [t !== "none" && /* @__PURE__ */ d("button", {
|
|
5525
|
+
type: "button",
|
|
5526
|
+
"aria-haspopup": "true",
|
|
5527
|
+
"aria-expanded": g ? void 0 : _,
|
|
5528
|
+
onClick: () => !g && v((e) => !e),
|
|
5529
|
+
style: {
|
|
5530
|
+
padding: "9px 16px",
|
|
5531
|
+
border: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))",
|
|
5532
|
+
borderRadius: 6,
|
|
5533
|
+
cursor: "pointer",
|
|
5534
|
+
fontSize: 15,
|
|
5535
|
+
fontFamily: "inherit",
|
|
5536
|
+
background: "var(--page-surface, transparent)",
|
|
5537
|
+
color: "inherit",
|
|
5538
|
+
display: "inline-flex",
|
|
5539
|
+
alignItems: "center",
|
|
5540
|
+
gap: 6
|
|
5541
|
+
},
|
|
5542
|
+
children: [n, /* @__PURE__ */ u("span", {
|
|
5543
|
+
"aria-hidden": "true",
|
|
5544
|
+
style: {
|
|
5545
|
+
fontSize: 10,
|
|
5546
|
+
opacity: .7
|
|
5547
|
+
},
|
|
5548
|
+
children: "▾"
|
|
5549
|
+
})]
|
|
5550
|
+
}), E]
|
|
5551
|
+
});
|
|
5552
|
+
}
|
|
5553
|
+
var or = {
|
|
5453
5554
|
PageRoot: ze,
|
|
5454
5555
|
CalendarBlock: Qn,
|
|
5455
5556
|
LogoCarousel: tr,
|
|
5456
5557
|
DialogBlock: ir,
|
|
5558
|
+
DropdownBlock: ar,
|
|
5457
5559
|
Section: Be,
|
|
5458
5560
|
Container: Ve,
|
|
5459
5561
|
Heading: He,
|
|
@@ -5508,39 +5610,39 @@ var ar = {
|
|
|
5508
5610
|
FormFile: cn,
|
|
5509
5611
|
FormRecaptcha: tn,
|
|
5510
5612
|
FormSubmit: ln
|
|
5511
|
-
},
|
|
5613
|
+
}, sr = {
|
|
5512
5614
|
id: "auth",
|
|
5513
5615
|
label: "Accounts",
|
|
5514
5616
|
category: "Apps",
|
|
5515
5617
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
5516
5618
|
ssr: "shell",
|
|
5517
5619
|
settings: ["site.authRedirect"]
|
|
5518
|
-
},
|
|
5620
|
+
}, cr = t({
|
|
5519
5621
|
user: null,
|
|
5520
5622
|
status: "idle",
|
|
5521
5623
|
ensure: () => {},
|
|
5522
5624
|
refresh: () => {},
|
|
5523
5625
|
signOut: () => {}
|
|
5524
5626
|
});
|
|
5525
|
-
function
|
|
5627
|
+
function lr(e, t) {
|
|
5526
5628
|
return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
|
|
5527
5629
|
}
|
|
5528
|
-
function
|
|
5630
|
+
function ur(e) {
|
|
5529
5631
|
let t = e && typeof e == "object" ? e["site.session"] : null, n = t && typeof t == "object" && !Array.isArray(t) ? t : {}, r = (e) => typeof e == "string" ? e.trim() : "", i = r(n.url), a = r(n.mePath), o = r(n.logoutPath);
|
|
5530
5632
|
return {
|
|
5531
5633
|
mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
|
|
5532
5634
|
url: i,
|
|
5533
5635
|
mePath: a,
|
|
5534
5636
|
logoutPath: o,
|
|
5535
|
-
meUrl:
|
|
5536
|
-
logoutUrl:
|
|
5637
|
+
meUrl: lr(i, a),
|
|
5638
|
+
logoutUrl: lr(i, o),
|
|
5537
5639
|
loginPage: r(n.loginPage),
|
|
5538
5640
|
userPath: r(n.userPath),
|
|
5539
5641
|
auth: n.auth === "bearer" ? "bearer" : "cookies",
|
|
5540
5642
|
tokenKey: r(n.tokenKey) || "webim_session_token"
|
|
5541
5643
|
};
|
|
5542
5644
|
}
|
|
5543
|
-
function
|
|
5645
|
+
function dr(e, t) {
|
|
5544
5646
|
if (!t) return e ?? null;
|
|
5545
5647
|
let n = e;
|
|
5546
5648
|
for (let e of t.split(".")) {
|
|
@@ -5549,26 +5651,26 @@ function ur(e, t) {
|
|
|
5549
5651
|
}
|
|
5550
5652
|
return n ?? null;
|
|
5551
5653
|
}
|
|
5552
|
-
function
|
|
5654
|
+
function fr(e) {
|
|
5553
5655
|
try {
|
|
5554
5656
|
return window.localStorage.getItem(e) || "";
|
|
5555
5657
|
} catch {
|
|
5556
5658
|
return "";
|
|
5557
5659
|
}
|
|
5558
5660
|
}
|
|
5559
|
-
function
|
|
5661
|
+
function pr(e) {
|
|
5560
5662
|
try {
|
|
5561
5663
|
window.localStorage.removeItem(e);
|
|
5562
5664
|
} catch {}
|
|
5563
5665
|
}
|
|
5564
|
-
var
|
|
5565
|
-
let e = r(
|
|
5666
|
+
var mr = () => {
|
|
5667
|
+
let e = r(cr);
|
|
5566
5668
|
return i(() => {
|
|
5567
5669
|
e.ensure();
|
|
5568
5670
|
}, [e]), e;
|
|
5569
5671
|
};
|
|
5570
|
-
function
|
|
5571
|
-
let f = r(Z), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", h = o(() =>
|
|
5672
|
+
function hr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
|
|
5673
|
+
let f = r(Z), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", h = o(() => ur(f?.settings), [f?.settings]), [g, _] = c(t ?? null), [v, y] = c(t ? "user" : a ? "guest" : "idle"), b = s(!1), x = n((e, t) => fetch(`${p}${e}`, {
|
|
5572
5674
|
...t,
|
|
5573
5675
|
credentials: "include",
|
|
5574
5676
|
headers: {
|
|
@@ -5580,9 +5682,9 @@ function mr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5580
5682
|
if (a) return Promise.resolve(null);
|
|
5581
5683
|
if (h.mode === "off") return Promise.resolve(S(null));
|
|
5582
5684
|
if (h.mode === "custom") {
|
|
5583
|
-
let e = h.auth === "bearer" ?
|
|
5685
|
+
let e = h.auth === "bearer" ? fr(h.tokenKey) : "";
|
|
5584
5686
|
return !h.meUrl || h.auth === "bearer" && !e ? Promise.resolve(S(null)) : fetch(h.meUrl, { ...h.auth === "bearer" ? { headers: { authorization: `Bearer ${e}` } } : { credentials: "include" } }).then((e) => e.ok ? e.json() : null).then((e) => {
|
|
5585
|
-
let t =
|
|
5687
|
+
let t = dr(e, h.userPath);
|
|
5586
5688
|
return S(t && typeof t == "object" ? t : null);
|
|
5587
5689
|
}).catch(() => S(null));
|
|
5588
5690
|
}
|
|
@@ -5595,12 +5697,12 @@ function mr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5595
5697
|
]), w = n(() => {
|
|
5596
5698
|
if (h.mode === "off") return S(null), Promise.resolve();
|
|
5597
5699
|
if (h.mode === "custom") {
|
|
5598
|
-
let e = h.auth === "bearer" ?
|
|
5700
|
+
let e = h.auth === "bearer" ? fr(h.tokenKey) : "";
|
|
5599
5701
|
return (h.logoutUrl ? fetch(h.logoutUrl, {
|
|
5600
5702
|
method: "post",
|
|
5601
5703
|
...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
|
|
5602
5704
|
}).catch(() => {}) : Promise.resolve()).then(() => {
|
|
5603
|
-
h.auth === "bearer" &&
|
|
5705
|
+
h.auth === "bearer" && pr(h.tokenKey), S(null);
|
|
5604
5706
|
});
|
|
5605
5707
|
}
|
|
5606
5708
|
return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
@@ -5650,18 +5752,18 @@ function mr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5650
5752
|
h.loginPage,
|
|
5651
5753
|
C,
|
|
5652
5754
|
w
|
|
5653
|
-
]), /* @__PURE__ */ u(
|
|
5755
|
+
]), /* @__PURE__ */ u(cr.Provider, {
|
|
5654
5756
|
value: E,
|
|
5655
5757
|
children: e
|
|
5656
5758
|
});
|
|
5657
5759
|
}
|
|
5658
|
-
function
|
|
5659
|
-
let { status: n } =
|
|
5760
|
+
function gr({ when: e, children: t }) {
|
|
5761
|
+
let { status: n } = mr();
|
|
5660
5762
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
5661
5763
|
}
|
|
5662
5764
|
//#endregion
|
|
5663
5765
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
5664
|
-
function
|
|
5766
|
+
function _r({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
|
|
5665
5767
|
let { tenant: h, apiUrl: g, settings: _ } = r(Z), [v, y] = c("form"), [b, x] = c(""), [S, C] = c(!1), w = e === "register", T = f ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
|
|
5666
5768
|
if (e.preventDefault(), f) return;
|
|
5667
5769
|
let n = new FormData(e.currentTarget);
|
|
@@ -5785,8 +5887,8 @@ function gr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5785
5887
|
]
|
|
5786
5888
|
});
|
|
5787
5889
|
}
|
|
5788
|
-
function
|
|
5789
|
-
let { user: c, status: l, signOut: f } =
|
|
5890
|
+
function vr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
5891
|
+
let { user: c, status: l, signOut: f } = mr(), p = a ? s || "user" : l, m = a ? {
|
|
5790
5892
|
name: "Ada Lovelace",
|
|
5791
5893
|
email: "ada@example.com"
|
|
5792
5894
|
} : c;
|
|
@@ -5851,40 +5953,40 @@ function _r({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5851
5953
|
}
|
|
5852
5954
|
//#endregion
|
|
5853
5955
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
5854
|
-
var
|
|
5956
|
+
var yr = {
|
|
5855
5957
|
id: "consent",
|
|
5856
5958
|
label: "Cookie consent",
|
|
5857
5959
|
category: "Apps",
|
|
5858
5960
|
keys: ["CookieConsent"],
|
|
5859
5961
|
ssr: "shell",
|
|
5860
5962
|
settings: []
|
|
5861
|
-
},
|
|
5862
|
-
function
|
|
5963
|
+
}, br = "webim.cookie_consent";
|
|
5964
|
+
function xr() {
|
|
5863
5965
|
try {
|
|
5864
|
-
let e = window.localStorage.getItem(
|
|
5966
|
+
let e = window.localStorage.getItem(br), t = e ? JSON.parse(e) : null;
|
|
5865
5967
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
5866
5968
|
} catch {
|
|
5867
5969
|
return "";
|
|
5868
5970
|
}
|
|
5869
5971
|
}
|
|
5870
|
-
function
|
|
5972
|
+
function Sr(e) {
|
|
5871
5973
|
try {
|
|
5872
5974
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
5873
5975
|
} catch {}
|
|
5874
5976
|
}
|
|
5875
|
-
function
|
|
5977
|
+
function Cr(e) {
|
|
5876
5978
|
try {
|
|
5877
|
-
window.localStorage.setItem(
|
|
5979
|
+
window.localStorage.setItem(br, JSON.stringify({
|
|
5878
5980
|
choice: e,
|
|
5879
5981
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5880
5982
|
}));
|
|
5881
5983
|
} catch {}
|
|
5882
|
-
|
|
5984
|
+
Sr(e);
|
|
5883
5985
|
try {
|
|
5884
5986
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
5885
5987
|
} catch {}
|
|
5886
5988
|
}
|
|
5887
|
-
var
|
|
5989
|
+
var wr = {
|
|
5888
5990
|
bottom: {
|
|
5889
5991
|
left: 0,
|
|
5890
5992
|
right: 0,
|
|
@@ -5906,18 +6008,18 @@ var Cr = {
|
|
|
5906
6008
|
maxWidth: 400
|
|
5907
6009
|
}
|
|
5908
6010
|
};
|
|
5909
|
-
function
|
|
6011
|
+
function Tr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
|
|
5910
6012
|
let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
|
|
5911
6013
|
y(e), typeof m == "function" && m(e);
|
|
5912
6014
|
};
|
|
5913
6015
|
if (i(() => {
|
|
5914
6016
|
if (h) return;
|
|
5915
|
-
let e =
|
|
5916
|
-
e ?
|
|
6017
|
+
let e = xr();
|
|
6018
|
+
e ? Sr(e) : _(!0);
|
|
5917
6019
|
}, [h, v]), !g) return null;
|
|
5918
6020
|
let x = (e) => () => {
|
|
5919
|
-
h || (
|
|
5920
|
-
}, S =
|
|
6021
|
+
h || (Cr(e), _(!1));
|
|
6022
|
+
}, S = wr[s] ?? wr.bottom, C = {
|
|
5921
6023
|
appearance: "none",
|
|
5922
6024
|
font: "inherit",
|
|
5923
6025
|
fontSize: 14,
|
|
@@ -5997,37 +6099,37 @@ function wr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
5997
6099
|
}
|
|
5998
6100
|
//#endregion
|
|
5999
6101
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
6000
|
-
var
|
|
6102
|
+
var Er = {
|
|
6001
6103
|
id: "language",
|
|
6002
6104
|
label: "Language",
|
|
6003
6105
|
category: "Apps",
|
|
6004
6106
|
keys: ["SiteLanguagePicker"],
|
|
6005
6107
|
ssr: "prefetch",
|
|
6006
6108
|
settings: ["locales"]
|
|
6007
|
-
},
|
|
6109
|
+
}, Dr = {
|
|
6008
6110
|
id: "search",
|
|
6009
6111
|
label: "Search",
|
|
6010
6112
|
category: "Apps",
|
|
6011
6113
|
keys: ["SiteSearch"],
|
|
6012
6114
|
ssr: "prefetch",
|
|
6013
6115
|
settings: []
|
|
6014
|
-
},
|
|
6015
|
-
function
|
|
6116
|
+
}, Or = 50, kr = 2e3;
|
|
6117
|
+
function Ar() {
|
|
6016
6118
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
6017
6119
|
}
|
|
6018
|
-
function
|
|
6120
|
+
function jr(e, t) {
|
|
6019
6121
|
let n = e?.data ?? {}, r = [];
|
|
6020
6122
|
for (let e of Object.values(n)) {
|
|
6021
6123
|
let t = e == null ? "" : Oe(e);
|
|
6022
|
-
if (t && r.push(t), r.join(" ").length >
|
|
6124
|
+
if (t && r.push(t), r.join(" ").length > kr) break;
|
|
6023
6125
|
}
|
|
6024
|
-
return r.join(" ").slice(0,
|
|
6126
|
+
return r.join(" ").slice(0, kr).toLocaleLowerCase(t || void 0);
|
|
6025
6127
|
}
|
|
6026
|
-
function
|
|
6027
|
-
let { tenant: b, apiUrl: x, locale: S } = r(Z), [C, w] = c(() =>
|
|
6128
|
+
function Mr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: a = !1, layout: o = "inline", includePages: l = !0, collections: f = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
|
|
6129
|
+
let { tenant: b, apiUrl: x, locale: S } = r(Z), [C, w] = c(() => Ar()), [T, E] = c(() => Ar()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
|
|
6028
6130
|
i(() => {
|
|
6029
6131
|
let e = () => {
|
|
6030
|
-
let e =
|
|
6132
|
+
let e = Ar();
|
|
6031
6133
|
w(e), E(e);
|
|
6032
6134
|
};
|
|
6033
6135
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -6078,7 +6180,7 @@ function jr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6078
6180
|
});
|
|
6079
6181
|
}
|
|
6080
6182
|
else for (let t of e.rows) {
|
|
6081
|
-
if (!
|
|
6183
|
+
if (!jr(t, S).includes(P)) continue;
|
|
6082
6184
|
let n = t?.data ?? {}, r = Oe(n.name) || "Untitled", i = Oe(n.slug);
|
|
6083
6185
|
F.push({
|
|
6084
6186
|
key: `entry:${t.id}`,
|
|
@@ -6087,7 +6189,7 @@ function jr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6087
6189
|
kind: "entry"
|
|
6088
6190
|
});
|
|
6089
6191
|
}
|
|
6090
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
6192
|
+
let I = F.slice(0, Math.min(Math.max(1, p), Or)), L = (e) => {
|
|
6091
6193
|
if (v) {
|
|
6092
6194
|
e.preventDefault(), w(T), j(!0);
|
|
6093
6195
|
return;
|
|
@@ -6227,21 +6329,21 @@ function jr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6227
6329
|
}
|
|
6228
6330
|
//#endregion
|
|
6229
6331
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
6230
|
-
function
|
|
6332
|
+
function Nr(e) {
|
|
6231
6333
|
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());
|
|
6232
6334
|
return [...new Set(n.map((e) => e.trim()))];
|
|
6233
6335
|
}
|
|
6234
|
-
var
|
|
6235
|
-
function
|
|
6336
|
+
var Pr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
6337
|
+
function Fr(e, t) {
|
|
6236
6338
|
let n = String(e ?? "").toUpperCase();
|
|
6237
6339
|
if (t === "code") return n;
|
|
6238
6340
|
let r = "";
|
|
6239
6341
|
try {
|
|
6240
|
-
r =
|
|
6342
|
+
r = Pr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
6241
6343
|
} catch {}
|
|
6242
6344
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
6243
6345
|
}
|
|
6244
|
-
function
|
|
6346
|
+
function Ir(e, t) {
|
|
6245
6347
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
6246
6348
|
if (typeof window > "u") return n || "?";
|
|
6247
6349
|
try {
|
|
@@ -6251,8 +6353,8 @@ function Fr(e, t) {
|
|
|
6251
6353
|
return n || "/";
|
|
6252
6354
|
}
|
|
6253
6355
|
}
|
|
6254
|
-
function
|
|
6255
|
-
let c = r(Z), l =
|
|
6356
|
+
function Lr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
|
|
6357
|
+
let c = r(Z), l = Nr(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
|
|
6256
6358
|
display: "inline-flex",
|
|
6257
6359
|
alignItems: "center",
|
|
6258
6360
|
gap: 8,
|
|
@@ -6287,7 +6389,7 @@ function Ir({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6287
6389
|
style: { opacity: .4 },
|
|
6288
6390
|
children: n ?? "·"
|
|
6289
6391
|
}), /* @__PURE__ */ u("a", {
|
|
6290
|
-
href:
|
|
6392
|
+
href: Ir(e, e === f),
|
|
6291
6393
|
hrefLang: e,
|
|
6292
6394
|
"aria-current": e === p ? "true" : void 0,
|
|
6293
6395
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -6297,7 +6399,7 @@ function Ir({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6297
6399
|
textDecoration: "none",
|
|
6298
6400
|
cursor: s ? "default" : "pointer"
|
|
6299
6401
|
},
|
|
6300
|
-
children:
|
|
6402
|
+
children: Fr(e, t)
|
|
6301
6403
|
})]
|
|
6302
6404
|
}, e))]
|
|
6303
6405
|
}) : /* @__PURE__ */ d("div", {
|
|
@@ -6308,7 +6410,7 @@ function Ir({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6308
6410
|
value: p,
|
|
6309
6411
|
onChange: s ? void 0 : (e) => {
|
|
6310
6412
|
let t = e.target.value;
|
|
6311
|
-
window.location.assign(
|
|
6413
|
+
window.location.assign(Ir(t, t === f));
|
|
6312
6414
|
},
|
|
6313
6415
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
6314
6416
|
style: {
|
|
@@ -6322,47 +6424,47 @@ function Ir({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6322
6424
|
},
|
|
6323
6425
|
children: l.map((e) => /* @__PURE__ */ u("option", {
|
|
6324
6426
|
value: e,
|
|
6325
|
-
children:
|
|
6427
|
+
children: Fr(e, t)
|
|
6326
6428
|
}, e))
|
|
6327
6429
|
})]
|
|
6328
6430
|
});
|
|
6329
6431
|
}
|
|
6330
6432
|
//#endregion
|
|
6331
6433
|
//#region ../ui/src/components/builder/apps/index.js
|
|
6332
|
-
var
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
],
|
|
6338
|
-
SiteLoginForm:
|
|
6339
|
-
SiteAccountMenu:
|
|
6340
|
-
SiteLanguagePicker:
|
|
6341
|
-
CookieConsent:
|
|
6342
|
-
SiteSearch:
|
|
6434
|
+
var Rr = [
|
|
6435
|
+
sr,
|
|
6436
|
+
Er,
|
|
6437
|
+
yr,
|
|
6438
|
+
Dr
|
|
6439
|
+
], zr = {
|
|
6440
|
+
SiteLoginForm: _r,
|
|
6441
|
+
SiteAccountMenu: vr,
|
|
6442
|
+
SiteLanguagePicker: Lr,
|
|
6443
|
+
CookieConsent: Tr,
|
|
6444
|
+
SiteSearch: Mr
|
|
6343
6445
|
};
|
|
6344
|
-
new Set(
|
|
6446
|
+
new Set(Rr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
6345
6447
|
//#endregion
|
|
6346
6448
|
//#region ../ui/src/components/builder/three/runtime.js
|
|
6347
|
-
var
|
|
6449
|
+
var Br = "0.185.1", Vr = "4.2.0", Hr = "https://cdn.jsdelivr.net/npm", Ur = `${Hr}/three@${Br}/+esm`, Wr = `${Hr}/@google/model-viewer@${Vr}/dist/model-viewer.min.js`, Gr = (e) => import(
|
|
6348
6450
|
/* @vite-ignore */
|
|
6349
6451
|
/* webpackIgnore: true */
|
|
6350
6452
|
e
|
|
6351
|
-
),
|
|
6352
|
-
function
|
|
6353
|
-
if (
|
|
6453
|
+
), Kr = /* @__PURE__ */ new Map();
|
|
6454
|
+
function qr(e) {
|
|
6455
|
+
if (Kr.has(e)) return Kr.get(e);
|
|
6354
6456
|
if (typeof window > "u") return new Promise(() => {});
|
|
6355
|
-
let t =
|
|
6356
|
-
throw
|
|
6457
|
+
let t = Gr(e).catch((t) => {
|
|
6458
|
+
throw Kr.delete(e), t;
|
|
6357
6459
|
});
|
|
6358
|
-
return
|
|
6460
|
+
return Kr.set(e, t), t;
|
|
6359
6461
|
}
|
|
6360
|
-
var
|
|
6361
|
-
function
|
|
6362
|
-
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) :
|
|
6462
|
+
var Jr = () => qr(Ur), Yr = (e) => qr(`${Hr}/three@${Br}/examples/jsm/${e}/+esm`);
|
|
6463
|
+
function Xr() {
|
|
6464
|
+
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : qr(Wr);
|
|
6363
6465
|
}
|
|
6364
|
-
var
|
|
6365
|
-
function
|
|
6466
|
+
var Zr = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Qr = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
|
|
6467
|
+
function $r(e, t) {
|
|
6366
6468
|
let n = 0, r = 0, i = 0, a = !0, o = (e) => {
|
|
6367
6469
|
n = requestAnimationFrame(o), i ||= e;
|
|
6368
6470
|
let a = r ? (e - r) / 1e3 : 0;
|
|
@@ -6381,7 +6483,7 @@ function Qr(e, t) {
|
|
|
6381
6483
|
s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
|
|
6382
6484
|
};
|
|
6383
6485
|
}
|
|
6384
|
-
function
|
|
6486
|
+
function ei(e, t, n = {}) {
|
|
6385
6487
|
let r = {
|
|
6386
6488
|
radius: n.distance ?? 4,
|
|
6387
6489
|
polar: n.polar ?? Math.PI / 2.4,
|
|
@@ -6430,13 +6532,13 @@ function $r(e, t, n = {}) {
|
|
|
6430
6532
|
}
|
|
6431
6533
|
//#endregion
|
|
6432
6534
|
//#region ../ui/src/components/builder/three/views.jsx
|
|
6433
|
-
var
|
|
6434
|
-
function
|
|
6535
|
+
var ti = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, ni = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, ri = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, ii = (e) => typeof e == "string" && !!e.trim();
|
|
6536
|
+
function ai({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
6435
6537
|
return /* @__PURE__ */ d("div", {
|
|
6436
6538
|
ref: r,
|
|
6437
6539
|
style: {
|
|
6438
6540
|
...A(i),
|
|
6439
|
-
minHeight:
|
|
6541
|
+
minHeight: ti(n, 320),
|
|
6440
6542
|
display: "flex",
|
|
6441
6543
|
flexDirection: "column",
|
|
6442
6544
|
alignItems: "center",
|
|
@@ -6445,7 +6547,7 @@ function ii({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
6445
6547
|
border: "1px dashed rgba(148,163,184,.55)",
|
|
6446
6548
|
borderRadius: 10,
|
|
6447
6549
|
background: "rgba(148,163,184,.08)",
|
|
6448
|
-
...
|
|
6550
|
+
...K,
|
|
6449
6551
|
color: "rgba(100,116,139,.95)",
|
|
6450
6552
|
fontSize: 13,
|
|
6451
6553
|
textAlign: "center",
|
|
@@ -6464,24 +6566,24 @@ function ii({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
6464
6566
|
}) : null]
|
|
6465
6567
|
});
|
|
6466
6568
|
}
|
|
6467
|
-
function
|
|
6569
|
+
function oi({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotateDelay: s, cameraControls: l, ar: d, exposure: f, shadow: p, fieldOfView: m, environment: h, style: g, nodeRef: _, inert: v }) {
|
|
6468
6570
|
let [y, b] = c(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = c(!1);
|
|
6469
6571
|
i(() => {
|
|
6470
6572
|
if (y || !e) return;
|
|
6471
6573
|
let t = !0;
|
|
6472
|
-
return
|
|
6574
|
+
return Xr().then(() => t && b(!0), () => t && S(!0)), () => {
|
|
6473
6575
|
t = !1;
|
|
6474
6576
|
};
|
|
6475
6577
|
}, [y, e]);
|
|
6476
6578
|
let C = {
|
|
6477
6579
|
display: "block",
|
|
6478
6580
|
width: "100%",
|
|
6479
|
-
minHeight:
|
|
6480
|
-
height:
|
|
6581
|
+
minHeight: ti(r, 360),
|
|
6582
|
+
height: ti(r, 360),
|
|
6481
6583
|
backgroundColor: a || "transparent",
|
|
6482
6584
|
...A(g)
|
|
6483
6585
|
};
|
|
6484
|
-
if (!e) return v ? /* @__PURE__ */ u(
|
|
6586
|
+
if (!e) return v ? /* @__PURE__ */ u(ai, {
|
|
6485
6587
|
nodeRef: _,
|
|
6486
6588
|
style: g,
|
|
6487
6589
|
height: r,
|
|
@@ -6516,13 +6618,13 @@ function ai({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotate
|
|
|
6516
6618
|
poster: t || void 0,
|
|
6517
6619
|
style: C,
|
|
6518
6620
|
"camera-controls": w(!v && l !== !1),
|
|
6519
|
-
"auto-rotate": w(T && !
|
|
6520
|
-
"auto-rotate-delay": T ? String(
|
|
6621
|
+
"auto-rotate": w(T && !Zr()),
|
|
6622
|
+
"auto-rotate-delay": T ? String(ti(s, 0)) : void 0,
|
|
6521
6623
|
"rotation-per-second": "18deg",
|
|
6522
6624
|
ar: w(!v && d === !0),
|
|
6523
6625
|
"ar-modes": "webxr scene-viewer quick-look",
|
|
6524
|
-
"shadow-intensity": String(
|
|
6525
|
-
exposure: String(
|
|
6626
|
+
"shadow-intensity": String(ni(p, 100)),
|
|
6627
|
+
exposure: String(ni(f, 100)),
|
|
6526
6628
|
"field-of-view": m ? `${Number(m)}deg` : void 0,
|
|
6527
6629
|
"environment-image": h && h !== "neutral" ? h : "neutral",
|
|
6528
6630
|
"interaction-prompt": v ? "none" : void 0,
|
|
@@ -6540,7 +6642,7 @@ function ai({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotate
|
|
|
6540
6642
|
}) : null
|
|
6541
6643
|
});
|
|
6542
6644
|
}
|
|
6543
|
-
var
|
|
6645
|
+
var si = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), ci = [
|
|
6544
6646
|
"precision highp float;",
|
|
6545
6647
|
"uniform vec2 u_res;",
|
|
6546
6648
|
"uniform float u_time;",
|
|
@@ -6563,7 +6665,7 @@ var oi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
6563
6665
|
" return v;",
|
|
6564
6666
|
"}",
|
|
6565
6667
|
""
|
|
6566
|
-
].join("\n"),
|
|
6668
|
+
].join("\n"), li = {
|
|
6567
6669
|
gradient: [
|
|
6568
6670
|
"void main(){",
|
|
6569
6671
|
" vec2 uv = gl_FragCoord.xy / u_res;",
|
|
@@ -6615,7 +6717,7 @@ var oi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
6615
6717
|
"}"
|
|
6616
6718
|
].join("\n")
|
|
6617
6719
|
};
|
|
6618
|
-
function
|
|
6720
|
+
function ui(e, t) {
|
|
6619
6721
|
let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
|
|
6620
6722
|
if (!n) return t;
|
|
6621
6723
|
let r = parseInt(n[1], 16);
|
|
@@ -6625,7 +6727,7 @@ function li(e, t) {
|
|
|
6625
6727
|
(r & 255) / 255
|
|
6626
6728
|
];
|
|
6627
6729
|
}
|
|
6628
|
-
function
|
|
6730
|
+
function di(e, t, n) {
|
|
6629
6731
|
let r = e.createShader(t);
|
|
6630
6732
|
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
6631
6733
|
let t = e.getShaderInfoLog(r);
|
|
@@ -6633,13 +6735,13 @@ function ui(e, t, n) {
|
|
|
6633
6735
|
}
|
|
6634
6736
|
return r;
|
|
6635
6737
|
}
|
|
6636
|
-
function
|
|
6738
|
+
function fi({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, scale: l, height: f, interactive: p, style: m, nodeRef: h, inert: g }) {
|
|
6637
6739
|
let _ = s(null), v = s(null), y = s(null), [b, x] = c("");
|
|
6638
6740
|
i(() => () => {
|
|
6639
6741
|
let e = y.current;
|
|
6640
6742
|
y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
|
|
6641
6743
|
}, []);
|
|
6642
|
-
let S = typeof t == "string" && t.trim() ? t :
|
|
6744
|
+
let S = typeof t == "string" && t.trim() ? t : li[e] ?? li.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(a ?? ""), E = ni(o, 100), D = Math.max(.05, ni(l, 100));
|
|
6643
6745
|
return i(() => {
|
|
6644
6746
|
let e = _.current, t = v.current;
|
|
6645
6747
|
if (!e || !t) return;
|
|
@@ -6654,7 +6756,7 @@ function di({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
6654
6756
|
}
|
|
6655
6757
|
let r = null;
|
|
6656
6758
|
try {
|
|
6657
|
-
let e =
|
|
6759
|
+
let e = di(n, n.VERTEX_SHADER, si), t = di(n, n.FRAGMENT_SHADER, ci + S);
|
|
6658
6760
|
if (r = n.createProgram(), n.attachShader(r, e), n.attachShader(r, t), n.linkProgram(r), !n.getProgramParameter(r, n.LINK_STATUS)) throw Error(n.getProgramInfoLog(r) || "Link failed");
|
|
6659
6761
|
x("");
|
|
6660
6762
|
} catch (e) {
|
|
@@ -6690,28 +6792,28 @@ function di({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
6690
6792
|
};
|
|
6691
6793
|
p !== !1 && t.addEventListener("pointermove", l);
|
|
6692
6794
|
let u = () => {
|
|
6693
|
-
let r =
|
|
6795
|
+
let r = Qr(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
|
|
6694
6796
|
(e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
|
|
6695
6797
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
6696
6798
|
d?.observe(t), u();
|
|
6697
|
-
let f =
|
|
6698
|
-
a:
|
|
6799
|
+
let f = Zr(), m = {
|
|
6800
|
+
a: ui(C, [
|
|
6699
6801
|
.35,
|
|
6700
6802
|
.4,
|
|
6701
6803
|
.95
|
|
6702
6804
|
]),
|
|
6703
|
-
b:
|
|
6805
|
+
b: ui(w, [
|
|
6704
6806
|
.05,
|
|
6705
6807
|
.06,
|
|
6706
6808
|
.16
|
|
6707
6809
|
]),
|
|
6708
|
-
c:
|
|
6810
|
+
c: ui(T, [
|
|
6709
6811
|
.95,
|
|
6710
6812
|
.35,
|
|
6711
6813
|
.6
|
|
6712
6814
|
])
|
|
6713
6815
|
}, h = {};
|
|
6714
|
-
return h.stop =
|
|
6816
|
+
return h.stop = $r(t, (t, r) => {
|
|
6715
6817
|
u(), n.uniform2f(s.res, e.width, e.height), n.uniform1f(s.time, (f ? 0 : r) * E), n.uniform2f(s.mouse, c.x, c.y), n.uniform3fv(s.a, m.a), n.uniform3fv(s.b, m.b), n.uniform3fv(s.c, m.c), n.uniform1f(s.scale, D), n.drawArrays(n.TRIANGLES, 0, 3), f && h.stop?.();
|
|
6716
6818
|
}), () => {
|
|
6717
6819
|
h.stop?.(), d?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i);
|
|
@@ -6730,7 +6832,7 @@ function di({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
6730
6832
|
},
|
|
6731
6833
|
style: {
|
|
6732
6834
|
position: "relative",
|
|
6733
|
-
minHeight:
|
|
6835
|
+
minHeight: ti(f, 320),
|
|
6734
6836
|
overflow: "hidden",
|
|
6735
6837
|
...A(m)
|
|
6736
6838
|
},
|
|
@@ -6752,7 +6854,7 @@ function di({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
6752
6854
|
justifyContent: "center",
|
|
6753
6855
|
padding: 12,
|
|
6754
6856
|
background: "rgba(15,23,42,.75)",
|
|
6755
|
-
...
|
|
6857
|
+
...K,
|
|
6756
6858
|
color: "#fecaca",
|
|
6757
6859
|
fontSize: 11,
|
|
6758
6860
|
whiteSpace: "pre-wrap",
|
|
@@ -6762,7 +6864,7 @@ function di({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
6762
6864
|
}) : null]
|
|
6763
6865
|
});
|
|
6764
6866
|
}
|
|
6765
|
-
function
|
|
6867
|
+
function pi(e, t) {
|
|
6766
6868
|
let n = new e.Scene(), r = new e.BoxGeometry();
|
|
6767
6869
|
r.deleteAttribute("uv");
|
|
6768
6870
|
let i = new e.Mesh(r, new e.MeshBasicMaterial({
|
|
@@ -6778,23 +6880,23 @@ function fi(e, t) {
|
|
|
6778
6880
|
let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
|
|
6779
6881
|
return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
|
|
6780
6882
|
}
|
|
6781
|
-
var
|
|
6782
|
-
function
|
|
6783
|
-
if (
|
|
6784
|
-
let t =
|
|
6883
|
+
var mi = /* @__PURE__ */ new Map();
|
|
6884
|
+
function hi(e) {
|
|
6885
|
+
if (mi.has(e)) return mi.get(e);
|
|
6886
|
+
let t = Yr("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
|
|
6785
6887
|
new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
|
|
6786
6888
|
})).catch((t) => {
|
|
6787
|
-
throw
|
|
6889
|
+
throw mi.delete(e), t;
|
|
6788
6890
|
});
|
|
6789
|
-
return
|
|
6891
|
+
return mi.set(e, t), t;
|
|
6790
6892
|
}
|
|
6791
|
-
function
|
|
6893
|
+
function gi(e, t) {
|
|
6792
6894
|
let n = new e.Box3().setFromObject(t);
|
|
6793
6895
|
if (n.isEmpty()) return t;
|
|
6794
6896
|
let r = n.getSize(new e.Vector3()), i = n.getCenter(new e.Vector3()), a = Math.max(r.x, r.y, r.z) || 1, o = new e.Group();
|
|
6795
6897
|
return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
|
|
6796
6898
|
}
|
|
6797
|
-
var
|
|
6899
|
+
var _i = {
|
|
6798
6900
|
box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
|
|
6799
6901
|
sphere: (e) => new e.SphereGeometry(.62, 48, 32),
|
|
6800
6902
|
torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
|
|
@@ -6803,50 +6905,50 @@ var gi = {
|
|
|
6803
6905
|
cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
|
|
6804
6906
|
plane: (e) => new e.PlaneGeometry(1.4, 1.4),
|
|
6805
6907
|
capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
|
|
6806
|
-
},
|
|
6807
|
-
function
|
|
6808
|
-
let g = s(null), [_, v] = c(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = a !== !1 && !
|
|
6908
|
+
}, vi = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
|
|
6909
|
+
function yi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: a, spinSpeed: o, controls: l, ground: d, height: f, style: p, nodeRef: m, inert: h }) {
|
|
6910
|
+
let g = s(null), [_, v] = c(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = a !== !1 && !Zr(), S = l !== !1 && !h;
|
|
6809
6911
|
return i(() => {
|
|
6810
6912
|
let e = g.current;
|
|
6811
6913
|
if (!e) return;
|
|
6812
6914
|
let i = !0, a = null;
|
|
6813
|
-
return
|
|
6915
|
+
return Jr().then((s) => {
|
|
6814
6916
|
if (!i || !e) return;
|
|
6815
6917
|
let c = new s.WebGLRenderer({
|
|
6816
6918
|
antialias: !0,
|
|
6817
6919
|
alpha: !t
|
|
6818
6920
|
});
|
|
6819
|
-
c.setPixelRatio(
|
|
6921
|
+
c.setPixelRatio(Qr()), c.shadowMap.enabled = d !== !1, c.shadowMap.type = s.PCFSoftShadowMap, c.outputColorSpace = s.SRGBColorSpace, c.toneMapping = s.ACESFilmicToneMapping, c.domElement.style.display = "block", c.domElement.style.width = "100%", c.domElement.style.height = "100%", e.appendChild(c.domElement);
|
|
6820
6922
|
let l = new s.Scene();
|
|
6821
|
-
t && (l.background = new s.Color(t)), l.environment =
|
|
6822
|
-
let u = new s.PerspectiveCamera(
|
|
6823
|
-
distance:
|
|
6923
|
+
t && (l.background = new s.Color(t)), l.environment = pi(s, c);
|
|
6924
|
+
let u = new s.PerspectiveCamera(vi(r, 45), 1, .1, 400), f = ei(u, c.domElement, {
|
|
6925
|
+
distance: vi(n, 5),
|
|
6824
6926
|
enableZoom: S
|
|
6825
6927
|
}), p = new s.DirectionalLight(16777215, 2.2);
|
|
6826
6928
|
p.position.set(4, 7, 5), p.castShadow = d !== !1, p.shadow.mapSize.set(1024, 1024), p.shadow.camera.near = .5, p.shadow.camera.far = 30, l.add(p, new s.AmbientLight(16777215, .35));
|
|
6827
6929
|
let m = [], h = new s.Group(), g = (e, t) => {
|
|
6828
|
-
let n =
|
|
6829
|
-
e.position.set(
|
|
6930
|
+
let n = vi(t.scale, 1);
|
|
6931
|
+
e.position.set(vi(t.x, 0), vi(t.y, 0), vi(t.z, 0)), e.rotation.set(ri(t.rx), ri(t.ry), ri(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = ri(t.spin);
|
|
6830
6932
|
};
|
|
6831
6933
|
for (let e of y) {
|
|
6832
6934
|
if (e.shape === "model") {
|
|
6833
|
-
if (!
|
|
6935
|
+
if (!ii(e.src)) continue;
|
|
6834
6936
|
let t = new s.Group();
|
|
6835
|
-
g(t, e), h.add(t),
|
|
6937
|
+
g(t, e), h.add(t), hi(e.src).then((e) => {
|
|
6836
6938
|
if (!i) return;
|
|
6837
|
-
let n =
|
|
6939
|
+
let n = gi(s, e.clone(!0));
|
|
6838
6940
|
n.traverse((e) => {
|
|
6839
6941
|
e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
|
|
6840
6942
|
}), t.add(n);
|
|
6841
6943
|
}, () => {});
|
|
6842
6944
|
continue;
|
|
6843
6945
|
}
|
|
6844
|
-
let t = (
|
|
6946
|
+
let t = (_i[e.shape] ?? _i.box)(s), n = new s.MeshStandardMaterial({
|
|
6845
6947
|
color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
|
|
6846
|
-
metalness: Math.min(1, Math.max(0,
|
|
6847
|
-
roughness: Math.min(1, Math.max(0,
|
|
6848
|
-
transparent:
|
|
6849
|
-
opacity: Math.min(1, Math.max(0,
|
|
6948
|
+
metalness: Math.min(1, Math.max(0, ni(e.metalness, 10))),
|
|
6949
|
+
roughness: Math.min(1, Math.max(0, ni(e.roughness, 35))),
|
|
6950
|
+
transparent: ni(e.opacity, 100) < 1,
|
|
6951
|
+
opacity: Math.min(1, Math.max(0, ni(e.opacity, 100))),
|
|
6850
6952
|
flatShading: e.flat === !0,
|
|
6851
6953
|
wireframe: e.wireframe === !0,
|
|
6852
6954
|
side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
|
|
@@ -6857,14 +6959,14 @@ function vi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
6857
6959
|
let _ = null;
|
|
6858
6960
|
if (d !== !1) {
|
|
6859
6961
|
let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
|
|
6860
|
-
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y =
|
|
6962
|
+
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = vi(d === !0 ? 0 : d, -.85), _.receiveShadow = !0, l.add(_), m.push(t, e);
|
|
6861
6963
|
}
|
|
6862
6964
|
let v = () => {
|
|
6863
6965
|
let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
|
|
6864
6966
|
c.setSize(t, n, !1), u.aspect = t / n, u.updateProjectionMatrix();
|
|
6865
6967
|
}, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
|
|
6866
6968
|
b?.observe(e), v();
|
|
6867
|
-
let C =
|
|
6969
|
+
let C = ri(Number.isFinite(Number(o)) ? o : 20), w = $r(e, (e) => {
|
|
6868
6970
|
f.autoSpin(x ? C : 0, e), f.update();
|
|
6869
6971
|
for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
|
|
6870
6972
|
c.render(l, u);
|
|
@@ -6888,7 +6990,7 @@ function vi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
6888
6990
|
o,
|
|
6889
6991
|
S,
|
|
6890
6992
|
d
|
|
6891
|
-
]), _ && h ? /* @__PURE__ */ u(
|
|
6993
|
+
]), _ && h ? /* @__PURE__ */ u(ai, {
|
|
6892
6994
|
nodeRef: m,
|
|
6893
6995
|
style: p,
|
|
6894
6996
|
height: f,
|
|
@@ -6899,27 +7001,27 @@ function vi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
6899
7001
|
g.current = e, typeof m == "function" && m(e);
|
|
6900
7002
|
},
|
|
6901
7003
|
style: {
|
|
6902
|
-
minHeight:
|
|
6903
|
-
height:
|
|
7004
|
+
minHeight: ti(f, 380),
|
|
7005
|
+
height: ti(f, 380),
|
|
6904
7006
|
overflow: "hidden",
|
|
6905
7007
|
touchAction: S ? "pan-y" : void 0,
|
|
6906
7008
|
...A(p)
|
|
6907
7009
|
}
|
|
6908
7010
|
});
|
|
6909
7011
|
}
|
|
6910
|
-
function
|
|
7012
|
+
function bi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o }) {
|
|
6911
7013
|
let l = s(null), [d, f] = c("");
|
|
6912
7014
|
return i(() => {
|
|
6913
7015
|
let t = l.current;
|
|
6914
7016
|
if (o || !t || typeof e != "string" || !e.trim()) return;
|
|
6915
7017
|
let r = !0, i = null;
|
|
6916
|
-
return
|
|
7018
|
+
return Jr().then((a) => {
|
|
6917
7019
|
if (!r || !t) return;
|
|
6918
7020
|
let o = new a.WebGLRenderer({
|
|
6919
7021
|
antialias: !0,
|
|
6920
7022
|
alpha: !n
|
|
6921
7023
|
});
|
|
6922
|
-
o.setPixelRatio(
|
|
7024
|
+
o.setPixelRatio(Qr()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
|
|
6923
7025
|
let s = new a.Scene();
|
|
6924
7026
|
n && (s.background = new a.Color(n));
|
|
6925
7027
|
let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
|
|
@@ -6942,7 +7044,7 @@ function yi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
6942
7044
|
o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
|
|
6943
7045
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
6944
7046
|
d?.observe(t), u();
|
|
6945
|
-
let p = !1, m =
|
|
7047
|
+
let p = !1, m = $r(t, (e, t) => {
|
|
6946
7048
|
if (!p && typeof l?.frame == "function") try {
|
|
6947
7049
|
l.frame(e, t);
|
|
6948
7050
|
} catch (e) {
|
|
@@ -6964,7 +7066,7 @@ function yi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
6964
7066
|
e,
|
|
6965
7067
|
o,
|
|
6966
7068
|
n
|
|
6967
|
-
]), o ? /* @__PURE__ */ u(
|
|
7069
|
+
]), o ? /* @__PURE__ */ u(ai, {
|
|
6968
7070
|
nodeRef: a,
|
|
6969
7071
|
style: r,
|
|
6970
7072
|
height: t,
|
|
@@ -6975,8 +7077,8 @@ function yi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
6975
7077
|
l.current = e, typeof a == "function" && a(e);
|
|
6976
7078
|
},
|
|
6977
7079
|
style: {
|
|
6978
|
-
minHeight:
|
|
6979
|
-
height:
|
|
7080
|
+
minHeight: ti(t, 380),
|
|
7081
|
+
height: ti(t, 380),
|
|
6980
7082
|
overflow: "hidden",
|
|
6981
7083
|
position: "relative",
|
|
6982
7084
|
touchAction: "pan-y",
|
|
@@ -6991,7 +7093,7 @@ function yi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
6991
7093
|
padding: "6px 8px",
|
|
6992
7094
|
borderRadius: 6,
|
|
6993
7095
|
background: "rgba(127,29,29,.85)",
|
|
6994
|
-
...
|
|
7096
|
+
...K,
|
|
6995
7097
|
color: "#fee2e2",
|
|
6996
7098
|
fontSize: 11
|
|
6997
7099
|
},
|
|
@@ -6999,40 +7101,40 @@ function yi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
6999
7101
|
}) : null
|
|
7000
7102
|
});
|
|
7001
7103
|
}
|
|
7002
|
-
var
|
|
7003
|
-
ModelViewerBlock:
|
|
7004
|
-
ShaderBlock:
|
|
7005
|
-
SceneBlock:
|
|
7006
|
-
ThreeCanvasBlock:
|
|
7007
|
-
},
|
|
7008
|
-
function
|
|
7009
|
-
if (
|
|
7104
|
+
var xi = {
|
|
7105
|
+
ModelViewerBlock: oi,
|
|
7106
|
+
ShaderBlock: fi,
|
|
7107
|
+
SceneBlock: yi,
|
|
7108
|
+
ThreeCanvasBlock: bi
|
|
7109
|
+
}, Si = /* @__PURE__ */ new Map();
|
|
7110
|
+
function Ci(e) {
|
|
7111
|
+
if (Si.has(e)) return Si.get(e);
|
|
7010
7112
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
7011
7113
|
/* @vite-ignore */
|
|
7012
7114
|
/* webpackIgnore: true */
|
|
7013
7115
|
t
|
|
7014
7116
|
).finally(() => URL.revokeObjectURL(t));
|
|
7015
|
-
return
|
|
7117
|
+
return Si.set(e, n), n;
|
|
7016
7118
|
}
|
|
7017
|
-
function
|
|
7119
|
+
function wi(e) {
|
|
7018
7120
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
7019
7121
|
return n && typeof n == "object" ? n : {};
|
|
7020
7122
|
}
|
|
7021
7123
|
//#endregion
|
|
7022
7124
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
7023
|
-
async function
|
|
7024
|
-
let n = await
|
|
7125
|
+
async function Ti(e, t) {
|
|
7126
|
+
let n = await Ci(e);
|
|
7025
7127
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
7026
7128
|
}
|
|
7027
|
-
var
|
|
7129
|
+
var Ei = {
|
|
7028
7130
|
padding: "10px 12px",
|
|
7029
7131
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
7030
7132
|
borderRadius: 8,
|
|
7031
7133
|
fontSize: 12,
|
|
7032
7134
|
opacity: .6
|
|
7033
7135
|
};
|
|
7034
|
-
function
|
|
7035
|
-
let c = r(Z), l =
|
|
7136
|
+
function Di({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
7137
|
+
let c = r(Z), l = wi(c?.settings)[e], f = s(null), p = s(null), m = {
|
|
7036
7138
|
tenant: c?.tenant ?? "",
|
|
7037
7139
|
apiUrl: c?.apiUrl ?? "/api",
|
|
7038
7140
|
locale: c?.locale ?? "",
|
|
@@ -7044,7 +7146,7 @@ function Ei({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
7044
7146
|
let e = f.current;
|
|
7045
7147
|
if (!l?.code || !e) return;
|
|
7046
7148
|
let n = !0;
|
|
7047
|
-
return
|
|
7149
|
+
return Ti(l.code, t).then((e) => {
|
|
7048
7150
|
if (!(!n || !e || !f.current)) {
|
|
7049
7151
|
p.current = e;
|
|
7050
7152
|
try {
|
|
@@ -7074,7 +7176,7 @@ function Ei({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
7074
7176
|
}) : /* @__PURE__ */ d("div", {
|
|
7075
7177
|
ref: o,
|
|
7076
7178
|
style: {
|
|
7077
|
-
...
|
|
7179
|
+
...Ei,
|
|
7078
7180
|
...A(a)
|
|
7079
7181
|
},
|
|
7080
7182
|
children: [
|
|
@@ -7086,13 +7188,13 @@ function Ei({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
7086
7188
|
}
|
|
7087
7189
|
//#endregion
|
|
7088
7190
|
//#region ../ui/src/components/builder/render.jsx
|
|
7089
|
-
var
|
|
7090
|
-
...
|
|
7091
|
-
...
|
|
7092
|
-
...
|
|
7093
|
-
PluginBlock:
|
|
7191
|
+
var Oi = {
|
|
7192
|
+
...or,
|
|
7193
|
+
...zr,
|
|
7194
|
+
...xi,
|
|
7195
|
+
PluginBlock: Di
|
|
7094
7196
|
};
|
|
7095
|
-
function
|
|
7197
|
+
function ki(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
7096
7198
|
let o = n[t];
|
|
7097
7199
|
if (!o || o.hidden) return null;
|
|
7098
7200
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -7100,11 +7202,11 @@ function Oi(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7100
7202
|
let n = o.props?.componentId, s = r?.[n];
|
|
7101
7203
|
if (!s?.template || i.has(n)) return null;
|
|
7102
7204
|
let c = new Set(i).add(n);
|
|
7103
|
-
return /* @__PURE__ */ u(e, { children:
|
|
7205
|
+
return /* @__PURE__ */ u(e, { children: ki(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
7104
7206
|
}
|
|
7105
|
-
let l =
|
|
7207
|
+
let l = Oi[s];
|
|
7106
7208
|
if (!l) return null;
|
|
7107
|
-
let d = (o.nodes ?? []).map((e) =>
|
|
7209
|
+
let d = (o.nodes ?? []).map((e) => ki(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, ki(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ u(l, {
|
|
7108
7210
|
...c,
|
|
7109
7211
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
7110
7212
|
linked: p,
|
|
@@ -7113,16 +7215,16 @@ function Oi(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7113
7215
|
},
|
|
7114
7216
|
children: d.length ? d : void 0
|
|
7115
7217
|
}, t);
|
|
7116
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ u(
|
|
7218
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ u(gr, {
|
|
7117
7219
|
when: c.when,
|
|
7118
7220
|
children: m
|
|
7119
7221
|
}, t) : m;
|
|
7120
7222
|
}
|
|
7121
7223
|
//#endregion
|
|
7122
7224
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
7123
|
-
var
|
|
7225
|
+
var Ai = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), ji = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ue(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
7124
7226
|
.webim-page[data-webim-mode="dark"] { ${Object.entries(ue(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
7125
|
-
function
|
|
7227
|
+
function Mi({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, animations: c, tenant: l, apiUrl: f, datasets: p, locale: m, direction: h, settings: _, siteUser: v }) {
|
|
7126
7228
|
let b = s?.js?.trim();
|
|
7127
7229
|
if (i(() => {
|
|
7128
7230
|
if (!b) return;
|
|
@@ -7136,11 +7238,11 @@ function ji({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7136
7238
|
minHeight: "100%",
|
|
7137
7239
|
display: "flex",
|
|
7138
7240
|
flexDirection: "column"
|
|
7139
|
-
}, w =
|
|
7241
|
+
}, w = ki("ROOT", e, n), T = o(() => ({ render: (t, r) => ki(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = W(e, n), O = ie(e, n), k = s?.css?.trim(), A = E(c), j = le(t), M = [j.font, j.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !oe[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
|
|
7140
7242
|
rel: "stylesheet",
|
|
7141
7243
|
precedence: "default",
|
|
7142
7244
|
href: g(e)
|
|
7143
|
-
}, e)), P =
|
|
7245
|
+
}, e)), P = ji(j);
|
|
7144
7246
|
return r === "auto" ? /* @__PURE__ */ u(Z.Provider, {
|
|
7145
7247
|
value: {
|
|
7146
7248
|
tenant: l || "",
|
|
@@ -7148,7 +7250,7 @@ function ji({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7148
7250
|
locale: m || "",
|
|
7149
7251
|
settings: _ ?? null
|
|
7150
7252
|
},
|
|
7151
|
-
children: /* @__PURE__ */ u(
|
|
7253
|
+
children: /* @__PURE__ */ u(hr, {
|
|
7152
7254
|
initialUser: v,
|
|
7153
7255
|
children: /* @__PURE__ */ u(xe.Provider, {
|
|
7154
7256
|
value: p ?? null,
|
|
@@ -7163,8 +7265,8 @@ function ji({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7163
7265
|
...a
|
|
7164
7266
|
},
|
|
7165
7267
|
children: [
|
|
7166
|
-
/* @__PURE__ */ u("style", { children: `.webim-page { ${
|
|
7167
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
7268
|
+
/* @__PURE__ */ u("style", { children: `.webim-page { ${Ai(ue(j.light))} }
|
|
7269
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Ai(ue(j.dark))} } }` }),
|
|
7168
7270
|
/* @__PURE__ */ u("style", { children: P }),
|
|
7169
7271
|
N,
|
|
7170
7272
|
/* @__PURE__ */ u("style", { children: S }),
|
|
@@ -7184,7 +7286,7 @@ function ji({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7184
7286
|
locale: m || "",
|
|
7185
7287
|
settings: _ ?? null
|
|
7186
7288
|
},
|
|
7187
|
-
children: /* @__PURE__ */ u(
|
|
7289
|
+
children: /* @__PURE__ */ u(hr, {
|
|
7188
7290
|
initialUser: v,
|
|
7189
7291
|
children: /* @__PURE__ */ u(xe.Provider, {
|
|
7190
7292
|
value: p ?? null,
|
|
@@ -7217,8 +7319,8 @@ function ji({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7217
7319
|
}
|
|
7218
7320
|
//#endregion
|
|
7219
7321
|
//#region src/WebimContent.jsx
|
|
7220
|
-
function
|
|
7221
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ u(
|
|
7322
|
+
function Ni({ bundle: e, mode: t = "auto", style: n }) {
|
|
7323
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(Mi, {
|
|
7222
7324
|
blocks: e.blocks,
|
|
7223
7325
|
theme: e.theme,
|
|
7224
7326
|
components: e.components,
|
|
@@ -7236,7 +7338,7 @@ function Mi({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
7236
7338
|
}
|
|
7237
7339
|
//#endregion
|
|
7238
7340
|
//#region src/WebimPage.jsx
|
|
7239
|
-
function
|
|
7341
|
+
function Pi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
|
|
7240
7342
|
let [g, _] = c({ status: "loading" }), v = s({
|
|
7241
7343
|
onLoad: m,
|
|
7242
7344
|
onError: h
|
|
@@ -7273,11 +7375,11 @@ function Ni({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
7273
7375
|
r,
|
|
7274
7376
|
a,
|
|
7275
7377
|
o
|
|
7276
|
-
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(
|
|
7378
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Ni, {
|
|
7277
7379
|
bundle: g.bundle,
|
|
7278
7380
|
mode: l,
|
|
7279
7381
|
style: d
|
|
7280
7382
|
});
|
|
7281
7383
|
}
|
|
7282
7384
|
//#endregion
|
|
7283
|
-
export {
|
|
7385
|
+
export { Mi as PageRenderer, Ni as WebimContent, Pi as WebimPage, ye as fetchPage, Ze as renderRichContent, he as resolveTheme };
|