webim-adapter 2.0.0 → 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 +64 -0
- package/README.md +24 -0
- package/build/webim-adapter.js +438 -300
- package/build/webim-embed.js +7 -7
- package/build/webim-ssr.js +488 -350
- package/package.json +15 -9
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 = {
|
|
@@ -1385,6 +1385,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1385
1385
|
position: "relative",
|
|
1386
1386
|
overflow: "hidden",
|
|
1387
1387
|
width: "100%",
|
|
1388
|
+
height: a,
|
|
1388
1389
|
touchAction: "pan-y",
|
|
1389
1390
|
userSelect: _ ? "none" : void 0,
|
|
1390
1391
|
cursor: _ ? "grabbing" : void 0,
|
|
@@ -1393,7 +1394,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1393
1394
|
children: [/* @__PURE__ */ u("div", {
|
|
1394
1395
|
style: {
|
|
1395
1396
|
display: "flex",
|
|
1396
|
-
height:
|
|
1397
|
+
height: "100%",
|
|
1397
1398
|
transform: `translateX(calc(${-y * 100}% + ${_?.dx ?? 0}px))`,
|
|
1398
1399
|
transition: _ ? "none" : "transform 450ms ease"
|
|
1399
1400
|
},
|
|
@@ -4453,32 +4454,32 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4453
4454
|
};
|
|
4454
4455
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4455
4456
|
}, [P, L]);
|
|
4456
|
-
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);
|
|
4457
4458
|
if (i(() => {
|
|
4458
|
-
if (!h ||
|
|
4459
|
-
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}`;
|
|
4460
4461
|
return fetch(r, { headers: H ? { "x-tenant": H } : {} }).then((e) => e.json()).then((t) => {
|
|
4461
4462
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4462
|
-
return e &&
|
|
4463
|
-
}).catch(() => e &&
|
|
4463
|
+
return e && ie(n);
|
|
4464
|
+
}).catch(() => e && ie([])), () => {
|
|
4464
4465
|
e = !1;
|
|
4465
4466
|
};
|
|
4466
4467
|
}, [
|
|
4467
4468
|
h,
|
|
4468
4469
|
H,
|
|
4469
4470
|
U,
|
|
4470
|
-
W,
|
|
4471
|
-
C,
|
|
4472
4471
|
te,
|
|
4472
|
+
C,
|
|
4473
|
+
ne,
|
|
4473
4474
|
g
|
|
4474
4475
|
]), !e.length) return null;
|
|
4475
|
-
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 ? {
|
|
4476
4477
|
y: 6,
|
|
4477
4478
|
x: 10
|
|
4478
4479
|
} : {
|
|
4479
4480
|
y: 10,
|
|
4480
4481
|
x: 14
|
|
4481
|
-
},
|
|
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 = [
|
|
4482
4483
|
"left",
|
|
4483
4484
|
"center",
|
|
4484
4485
|
"right"
|
|
@@ -4498,7 +4499,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4498
4499
|
};
|
|
4499
4500
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4500
4501
|
}, ye = /* @__PURE__ */ new Set();
|
|
4501
|
-
p &&
|
|
4502
|
+
p && K.forEach((t, n) => e.forEach((e, t) => {
|
|
4502
4503
|
let r = p[Hn(a[n], o[t])];
|
|
4503
4504
|
if (!r) return;
|
|
4504
4505
|
let i = Math.max(1, Number(r.c) || 1), s = Math.max(1, Number(r.r) || 1);
|
|
@@ -4522,7 +4523,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4522
4523
|
},
|
|
4523
4524
|
onClick: n,
|
|
4524
4525
|
children: e
|
|
4525
|
-
}, 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);
|
|
4526
4527
|
return /* @__PURE__ */ d("div", {
|
|
4527
4528
|
ref: (e) => {
|
|
4528
4529
|
I.current = e, typeof N == "function" && N(e);
|
|
@@ -4549,8 +4550,8 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4549
4550
|
Y("+↑", Q("rowAbove", "Insert row above"), () => P.addRow(X.r - 1)),
|
|
4550
4551
|
Y("+↓", Q("rowBelow", "Insert row below"), () => P.addRow(X.r)),
|
|
4551
4552
|
Y("↑", Q("rowUp", "Move row up"), () => P.moveRow(X.r, -1), X.r === 0),
|
|
4552
|
-
Y("↓", Q("rowDown", "Move row down"), () => P.moveRow(X.r, 1), X.r >=
|
|
4553
|
-
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),
|
|
4554
4555
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4555
4556
|
Y("+←", Q("colLeft", "Insert column left"), () => P.addColumn(X.c - 1)),
|
|
4556
4557
|
Y("+→", Q("colRight", "Insert column right"), () => P.addColumn(X.c)),
|
|
@@ -4559,7 +4560,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4559
4560
|
Y("✕ col", Q("colDelete", "Delete column"), () => P.dropColumn(X.c), e.length <= 1),
|
|
4560
4561
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4561
4562
|
Y("↔", Q("mergeRight", "Merge with the cell on the right"), () => P.merge(X.r, X.c, "right"), X.c + we >= e.length),
|
|
4562
|
-
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),
|
|
4563
4564
|
Y("⤫", Q("split", "Split this cell"), () => P.split(X.r, X.c), we === 1 && Te === 1)
|
|
4564
4565
|
]
|
|
4565
4566
|
}),
|
|
@@ -4589,7 +4590,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4589
4590
|
style: {
|
|
4590
4591
|
textAlign: de(n),
|
|
4591
4592
|
fontWeight: 600,
|
|
4592
|
-
padding:
|
|
4593
|
+
padding: J,
|
|
4593
4594
|
...typeof D == "string" && D ? { color: D } : null,
|
|
4594
4595
|
background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
|
|
4595
4596
|
...T ? {
|
|
@@ -4610,16 +4611,16 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4610
4611
|
onPointerDown: ve(n)
|
|
4611
4612
|
})] }) : t.label ?? t
|
|
4612
4613
|
}, n)) }) }),
|
|
4613
|
-
/* @__PURE__ */ d("tbody", { children: [
|
|
4614
|
+
/* @__PURE__ */ d("tbody", { children: [ae && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
4614
4615
|
colSpan: e.length,
|
|
4615
4616
|
style: {
|
|
4616
|
-
padding:
|
|
4617
|
+
padding: J,
|
|
4617
4618
|
textAlign: "center",
|
|
4618
4619
|
opacity: .6,
|
|
4619
4620
|
...se
|
|
4620
4621
|
},
|
|
4621
4622
|
children: w || "No data yet"
|
|
4622
|
-
}) }),
|
|
4623
|
+
}) }), K.map((t, n) => /* @__PURE__ */ u("tr", {
|
|
4623
4624
|
className: P ? "wb-tedit-row" : void 0,
|
|
4624
4625
|
style: {
|
|
4625
4626
|
...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
|
|
@@ -4635,7 +4636,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4635
4636
|
colSpan: l > 1 ? l : void 0,
|
|
4636
4637
|
rowSpan: f > 1 ? f : void 0,
|
|
4637
4638
|
style: {
|
|
4638
|
-
padding:
|
|
4639
|
+
padding: J,
|
|
4639
4640
|
...ue(r) ? { textAlign: ue(r) } : null,
|
|
4640
4641
|
...P ? { position: "relative" } : null,
|
|
4641
4642
|
...se
|
|
@@ -4801,7 +4802,7 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4801
4802
|
year: n.getFullYear(),
|
|
4802
4803
|
month: n.getMonth()
|
|
4803
4804
|
};
|
|
4804
|
-
}),
|
|
4805
|
+
}), te = (e, t) => /* @__PURE__ */ u("button", {
|
|
4805
4806
|
type: "button",
|
|
4806
4807
|
"aria-label": e,
|
|
4807
4808
|
onClick: () => ee(t),
|
|
@@ -4816,7 +4817,7 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4816
4817
|
padding: "4px 8px"
|
|
4817
4818
|
},
|
|
4818
4819
|
children: t < 0 ? "‹" : "›"
|
|
4819
|
-
}),
|
|
4820
|
+
}), ne = /* @__PURE__ */ d("div", {
|
|
4820
4821
|
style: {
|
|
4821
4822
|
display: "flex",
|
|
4822
4823
|
alignItems: "center",
|
|
@@ -4833,8 +4834,8 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4833
4834
|
},
|
|
4834
4835
|
children: U
|
|
4835
4836
|
}),
|
|
4836
|
-
|
|
4837
|
-
|
|
4837
|
+
te("Previous month", -1),
|
|
4838
|
+
te("Next month", 1)
|
|
4838
4839
|
]
|
|
4839
4840
|
});
|
|
4840
4841
|
if (p === "list") {
|
|
@@ -4850,7 +4851,7 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4850
4851
|
width: "100%",
|
|
4851
4852
|
...A(S)
|
|
4852
4853
|
},
|
|
4853
|
-
children: [
|
|
4854
|
+
children: [ne, e.length ? /* @__PURE__ */ u("div", {
|
|
4854
4855
|
style: {
|
|
4855
4856
|
display: "flex",
|
|
4856
4857
|
flexDirection: "column",
|
|
@@ -4886,10 +4887,10 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4886
4887
|
})]
|
|
4887
4888
|
});
|
|
4888
4889
|
}
|
|
4889
|
-
let
|
|
4890
|
-
for (let e = 0; e <
|
|
4891
|
-
let t = e -
|
|
4892
|
-
|
|
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", {
|
|
4893
4894
|
style: {
|
|
4894
4895
|
minHeight: P.cell,
|
|
4895
4896
|
borderTop: `1px solid ${I}`,
|
|
@@ -4932,7 +4933,7 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4932
4933
|
...A(S)
|
|
4933
4934
|
},
|
|
4934
4935
|
children: [
|
|
4935
|
-
|
|
4936
|
+
ne,
|
|
4936
4937
|
/* @__PURE__ */ d("div", {
|
|
4937
4938
|
style: {
|
|
4938
4939
|
display: "grid",
|
|
@@ -4946,8 +4947,8 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4946
4947
|
textAlign: "center",
|
|
4947
4948
|
padding: `0 0 ${P.pad}px`
|
|
4948
4949
|
},
|
|
4949
|
-
children:
|
|
4950
|
-
}, `head-${t}`)),
|
|
4950
|
+
children: q.format(new Date(2024, 0, 7 + ie + t))
|
|
4951
|
+
}, `head-${t}`)), J]
|
|
4951
4952
|
}),
|
|
4952
4953
|
/* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4953
4954
|
]
|
|
@@ -4970,7 +4971,7 @@ function er(e, t = {}) {
|
|
|
4970
4971
|
}).filter((e) => e.src);
|
|
4971
4972
|
}
|
|
4972
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 }) {
|
|
4973
|
-
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);
|
|
4974
4975
|
i(() => {
|
|
4975
4976
|
if (!t || k) return;
|
|
4976
4977
|
let e = !0;
|
|
@@ -4987,7 +4988,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
4987
4988
|
k
|
|
4988
4989
|
]), i(() => {
|
|
4989
4990
|
if (typeof window > "u" || !window.matchMedia) return;
|
|
4990
|
-
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () =>
|
|
4991
|
+
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => ne(e.matches);
|
|
4991
4992
|
return t(), e.addEventListener?.("change", t), () => e.removeEventListener?.("change", t);
|
|
4992
4993
|
}, []), i(() => {
|
|
4993
4994
|
let e = P.current;
|
|
@@ -5000,7 +5001,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5000
5001
|
let e = N.current;
|
|
5001
5002
|
if (!e) return;
|
|
5002
5003
|
let t = !0, n = () => {
|
|
5003
|
-
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);
|
|
5004
5005
|
t && n.length && R(Math.ceil(Math.max(...n)));
|
|
5005
5006
|
};
|
|
5006
5007
|
n();
|
|
@@ -5009,12 +5010,12 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5009
5010
|
t = !1, r.forEach((e) => e.removeEventListener("load", n));
|
|
5010
5011
|
};
|
|
5011
5012
|
});
|
|
5012
|
-
let
|
|
5013
|
+
let re = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], ie = t ? er(k ?? j ?? [], {
|
|
5013
5014
|
imageField: n,
|
|
5014
5015
|
nameField: a,
|
|
5015
5016
|
hrefField: o
|
|
5016
|
-
}) :
|
|
5017
|
-
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", {
|
|
5018
5019
|
ref: T,
|
|
5019
5020
|
style: {
|
|
5020
5021
|
width: "100%",
|
|
@@ -5026,7 +5027,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5026
5027
|
alignItems: "center",
|
|
5027
5028
|
justifyContent: "center",
|
|
5028
5029
|
flexWrap: "wrap",
|
|
5029
|
-
gap:
|
|
5030
|
+
gap: G
|
|
5030
5031
|
},
|
|
5031
5032
|
children: [
|
|
5032
5033
|
0,
|
|
@@ -5036,16 +5037,16 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5036
5037
|
4
|
|
5037
5038
|
].map((e) => /* @__PURE__ */ u("div", {
|
|
5038
5039
|
style: {
|
|
5039
|
-
height:
|
|
5040
|
-
width:
|
|
5040
|
+
height: W,
|
|
5041
|
+
width: W * 3,
|
|
5041
5042
|
border: "1px dashed var(--page-border, rgba(148, 163, 184, 0.5))",
|
|
5042
5043
|
borderRadius: 6,
|
|
5043
5044
|
display: "flex",
|
|
5044
5045
|
alignItems: "center",
|
|
5045
5046
|
justifyContent: "center",
|
|
5046
|
-
fontSize: Math.max(10, Math.round(
|
|
5047
|
+
fontSize: Math.max(10, Math.round(W / 4)),
|
|
5047
5048
|
opacity: .45,
|
|
5048
|
-
...
|
|
5049
|
+
...K
|
|
5049
5050
|
},
|
|
5050
5051
|
children: "LOGO"
|
|
5051
5052
|
}, e))
|
|
@@ -5059,12 +5060,12 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5059
5060
|
children: C
|
|
5060
5061
|
}) : null
|
|
5061
5062
|
});
|
|
5062
|
-
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) => {
|
|
5063
5064
|
let r = /* @__PURE__ */ u("img", {
|
|
5064
5065
|
src: e.src,
|
|
5065
5066
|
alt: e.alt ?? "",
|
|
5066
5067
|
style: {
|
|
5067
|
-
height:
|
|
5068
|
+
height: W,
|
|
5068
5069
|
width: "auto",
|
|
5069
5070
|
maxWidth: "100%",
|
|
5070
5071
|
objectFit: "contain",
|
|
@@ -5073,7 +5074,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5073
5074
|
}), i = fe ? {
|
|
5074
5075
|
width: ue,
|
|
5075
5076
|
flex: "0 0 auto",
|
|
5076
|
-
padding: `0 ${
|
|
5077
|
+
padding: `0 ${G / 2}px`,
|
|
5077
5078
|
justifyContent: "center"
|
|
5078
5079
|
} : {};
|
|
5079
5080
|
return e.href && !E ? /* @__PURE__ */ u("a", {
|
|
@@ -5105,14 +5106,14 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5105
5106
|
...fe ? {
|
|
5106
5107
|
width: _e.length * ue,
|
|
5107
5108
|
transform: `translateX(-${ve}px)`,
|
|
5108
|
-
transition: V ? `transform ${
|
|
5109
|
+
transition: V ? `transform ${J}ms ease` : "none"
|
|
5109
5110
|
} : pe ? {
|
|
5110
|
-
gap:
|
|
5111
|
+
gap: G,
|
|
5111
5112
|
overflowX: "auto",
|
|
5112
5113
|
scrollBehavior: "smooth",
|
|
5113
5114
|
scrollSnapType: "x proximity"
|
|
5114
5115
|
} : {
|
|
5115
|
-
gap:
|
|
5116
|
+
gap: G,
|
|
5116
5117
|
flexWrap: "wrap",
|
|
5117
5118
|
justifyContent: "center"
|
|
5118
5119
|
}
|
|
@@ -5200,8 +5201,8 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5200
5201
|
] }),
|
|
5201
5202
|
/* @__PURE__ */ u(nr, {
|
|
5202
5203
|
running: me,
|
|
5203
|
-
every:
|
|
5204
|
-
slide:
|
|
5204
|
+
every: q + J,
|
|
5205
|
+
slide: J,
|
|
5205
5206
|
step: he ? -1 : 1,
|
|
5206
5207
|
index: z,
|
|
5207
5208
|
total: de,
|
|
@@ -5448,11 +5449,113 @@ function ir({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5448
5449
|
})]
|
|
5449
5450
|
});
|
|
5450
5451
|
}
|
|
5451
|
-
|
|
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 = {
|
|
5452
5554
|
PageRoot: ze,
|
|
5453
5555
|
CalendarBlock: Qn,
|
|
5454
5556
|
LogoCarousel: tr,
|
|
5455
5557
|
DialogBlock: ir,
|
|
5558
|
+
DropdownBlock: ar,
|
|
5456
5559
|
Section: Be,
|
|
5457
5560
|
Container: Ve,
|
|
5458
5561
|
Heading: He,
|
|
@@ -5507,39 +5610,39 @@ var ar = {
|
|
|
5507
5610
|
FormFile: cn,
|
|
5508
5611
|
FormRecaptcha: tn,
|
|
5509
5612
|
FormSubmit: ln
|
|
5510
|
-
},
|
|
5613
|
+
}, sr = {
|
|
5511
5614
|
id: "auth",
|
|
5512
5615
|
label: "Accounts",
|
|
5513
5616
|
category: "Apps",
|
|
5514
5617
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
5515
5618
|
ssr: "shell",
|
|
5516
5619
|
settings: ["site.authRedirect"]
|
|
5517
|
-
},
|
|
5620
|
+
}, cr = t({
|
|
5518
5621
|
user: null,
|
|
5519
5622
|
status: "idle",
|
|
5520
5623
|
ensure: () => {},
|
|
5521
5624
|
refresh: () => {},
|
|
5522
5625
|
signOut: () => {}
|
|
5523
5626
|
});
|
|
5524
|
-
function
|
|
5627
|
+
function lr(e, t) {
|
|
5525
5628
|
return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
|
|
5526
5629
|
}
|
|
5527
|
-
function
|
|
5630
|
+
function ur(e) {
|
|
5528
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);
|
|
5529
5632
|
return {
|
|
5530
5633
|
mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
|
|
5531
5634
|
url: i,
|
|
5532
5635
|
mePath: a,
|
|
5533
5636
|
logoutPath: o,
|
|
5534
|
-
meUrl:
|
|
5535
|
-
logoutUrl:
|
|
5637
|
+
meUrl: lr(i, a),
|
|
5638
|
+
logoutUrl: lr(i, o),
|
|
5536
5639
|
loginPage: r(n.loginPage),
|
|
5537
5640
|
userPath: r(n.userPath),
|
|
5538
5641
|
auth: n.auth === "bearer" ? "bearer" : "cookies",
|
|
5539
5642
|
tokenKey: r(n.tokenKey) || "webim_session_token"
|
|
5540
5643
|
};
|
|
5541
5644
|
}
|
|
5542
|
-
function
|
|
5645
|
+
function dr(e, t) {
|
|
5543
5646
|
if (!t) return e ?? null;
|
|
5544
5647
|
let n = e;
|
|
5545
5648
|
for (let e of t.split(".")) {
|
|
@@ -5548,26 +5651,26 @@ function ur(e, t) {
|
|
|
5548
5651
|
}
|
|
5549
5652
|
return n ?? null;
|
|
5550
5653
|
}
|
|
5551
|
-
function
|
|
5654
|
+
function fr(e) {
|
|
5552
5655
|
try {
|
|
5553
5656
|
return window.localStorage.getItem(e) || "";
|
|
5554
5657
|
} catch {
|
|
5555
5658
|
return "";
|
|
5556
5659
|
}
|
|
5557
5660
|
}
|
|
5558
|
-
function
|
|
5661
|
+
function pr(e) {
|
|
5559
5662
|
try {
|
|
5560
5663
|
window.localStorage.removeItem(e);
|
|
5561
5664
|
} catch {}
|
|
5562
5665
|
}
|
|
5563
|
-
var
|
|
5564
|
-
let e = r(
|
|
5666
|
+
var mr = () => {
|
|
5667
|
+
let e = r(cr);
|
|
5565
5668
|
return i(() => {
|
|
5566
5669
|
e.ensure();
|
|
5567
5670
|
}, [e]), e;
|
|
5568
5671
|
};
|
|
5569
|
-
function
|
|
5570
|
-
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}`, {
|
|
5571
5674
|
...t,
|
|
5572
5675
|
credentials: "include",
|
|
5573
5676
|
headers: {
|
|
@@ -5579,9 +5682,9 @@ function mr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5579
5682
|
if (a) return Promise.resolve(null);
|
|
5580
5683
|
if (h.mode === "off") return Promise.resolve(S(null));
|
|
5581
5684
|
if (h.mode === "custom") {
|
|
5582
|
-
let e = h.auth === "bearer" ?
|
|
5685
|
+
let e = h.auth === "bearer" ? fr(h.tokenKey) : "";
|
|
5583
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) => {
|
|
5584
|
-
let t =
|
|
5687
|
+
let t = dr(e, h.userPath);
|
|
5585
5688
|
return S(t && typeof t == "object" ? t : null);
|
|
5586
5689
|
}).catch(() => S(null));
|
|
5587
5690
|
}
|
|
@@ -5594,12 +5697,12 @@ function mr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5594
5697
|
]), w = n(() => {
|
|
5595
5698
|
if (h.mode === "off") return S(null), Promise.resolve();
|
|
5596
5699
|
if (h.mode === "custom") {
|
|
5597
|
-
let e = h.auth === "bearer" ?
|
|
5700
|
+
let e = h.auth === "bearer" ? fr(h.tokenKey) : "";
|
|
5598
5701
|
return (h.logoutUrl ? fetch(h.logoutUrl, {
|
|
5599
5702
|
method: "post",
|
|
5600
5703
|
...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
|
|
5601
5704
|
}).catch(() => {}) : Promise.resolve()).then(() => {
|
|
5602
|
-
h.auth === "bearer" &&
|
|
5705
|
+
h.auth === "bearer" && pr(h.tokenKey), S(null);
|
|
5603
5706
|
});
|
|
5604
5707
|
}
|
|
5605
5708
|
return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
@@ -5649,18 +5752,18 @@ function mr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5649
5752
|
h.loginPage,
|
|
5650
5753
|
C,
|
|
5651
5754
|
w
|
|
5652
|
-
]), /* @__PURE__ */ u(
|
|
5755
|
+
]), /* @__PURE__ */ u(cr.Provider, {
|
|
5653
5756
|
value: E,
|
|
5654
5757
|
children: e
|
|
5655
5758
|
});
|
|
5656
5759
|
}
|
|
5657
|
-
function
|
|
5658
|
-
let { status: n } =
|
|
5760
|
+
function gr({ when: e, children: t }) {
|
|
5761
|
+
let { status: n } = mr();
|
|
5659
5762
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
5660
5763
|
}
|
|
5661
5764
|
//#endregion
|
|
5662
5765
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
5663
|
-
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 }) {
|
|
5664
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) => {
|
|
5665
5768
|
if (e.preventDefault(), f) return;
|
|
5666
5769
|
let n = new FormData(e.currentTarget);
|
|
@@ -5784,8 +5887,8 @@ function gr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5784
5887
|
]
|
|
5785
5888
|
});
|
|
5786
5889
|
}
|
|
5787
|
-
function
|
|
5788
|
-
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 ? {
|
|
5789
5892
|
name: "Ada Lovelace",
|
|
5790
5893
|
email: "ada@example.com"
|
|
5791
5894
|
} : c;
|
|
@@ -5850,40 +5953,40 @@ function _r({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5850
5953
|
}
|
|
5851
5954
|
//#endregion
|
|
5852
5955
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
5853
|
-
var
|
|
5956
|
+
var yr = {
|
|
5854
5957
|
id: "consent",
|
|
5855
5958
|
label: "Cookie consent",
|
|
5856
5959
|
category: "Apps",
|
|
5857
5960
|
keys: ["CookieConsent"],
|
|
5858
5961
|
ssr: "shell",
|
|
5859
5962
|
settings: []
|
|
5860
|
-
},
|
|
5861
|
-
function
|
|
5963
|
+
}, br = "webim.cookie_consent";
|
|
5964
|
+
function xr() {
|
|
5862
5965
|
try {
|
|
5863
|
-
let e = window.localStorage.getItem(
|
|
5966
|
+
let e = window.localStorage.getItem(br), t = e ? JSON.parse(e) : null;
|
|
5864
5967
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
5865
5968
|
} catch {
|
|
5866
5969
|
return "";
|
|
5867
5970
|
}
|
|
5868
5971
|
}
|
|
5869
|
-
function
|
|
5972
|
+
function Sr(e) {
|
|
5870
5973
|
try {
|
|
5871
5974
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
5872
5975
|
} catch {}
|
|
5873
5976
|
}
|
|
5874
|
-
function
|
|
5977
|
+
function Cr(e) {
|
|
5875
5978
|
try {
|
|
5876
|
-
window.localStorage.setItem(
|
|
5979
|
+
window.localStorage.setItem(br, JSON.stringify({
|
|
5877
5980
|
choice: e,
|
|
5878
5981
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5879
5982
|
}));
|
|
5880
5983
|
} catch {}
|
|
5881
|
-
|
|
5984
|
+
Sr(e);
|
|
5882
5985
|
try {
|
|
5883
5986
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
5884
5987
|
} catch {}
|
|
5885
5988
|
}
|
|
5886
|
-
var
|
|
5989
|
+
var wr = {
|
|
5887
5990
|
bottom: {
|
|
5888
5991
|
left: 0,
|
|
5889
5992
|
right: 0,
|
|
@@ -5905,18 +6008,18 @@ var Cr = {
|
|
|
5905
6008
|
maxWidth: 400
|
|
5906
6009
|
}
|
|
5907
6010
|
};
|
|
5908
|
-
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 }) {
|
|
5909
6012
|
let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
|
|
5910
6013
|
y(e), typeof m == "function" && m(e);
|
|
5911
6014
|
};
|
|
5912
6015
|
if (i(() => {
|
|
5913
6016
|
if (h) return;
|
|
5914
|
-
let e =
|
|
5915
|
-
e ?
|
|
6017
|
+
let e = xr();
|
|
6018
|
+
e ? Sr(e) : _(!0);
|
|
5916
6019
|
}, [h, v]), !g) return null;
|
|
5917
6020
|
let x = (e) => () => {
|
|
5918
|
-
h || (
|
|
5919
|
-
}, S =
|
|
6021
|
+
h || (Cr(e), _(!1));
|
|
6022
|
+
}, S = wr[s] ?? wr.bottom, C = {
|
|
5920
6023
|
appearance: "none",
|
|
5921
6024
|
font: "inherit",
|
|
5922
6025
|
fontSize: 14,
|
|
@@ -5996,37 +6099,37 @@ function wr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
5996
6099
|
}
|
|
5997
6100
|
//#endregion
|
|
5998
6101
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
5999
|
-
var
|
|
6102
|
+
var Er = {
|
|
6000
6103
|
id: "language",
|
|
6001
6104
|
label: "Language",
|
|
6002
6105
|
category: "Apps",
|
|
6003
6106
|
keys: ["SiteLanguagePicker"],
|
|
6004
6107
|
ssr: "prefetch",
|
|
6005
6108
|
settings: ["locales"]
|
|
6006
|
-
},
|
|
6109
|
+
}, Dr = {
|
|
6007
6110
|
id: "search",
|
|
6008
6111
|
label: "Search",
|
|
6009
6112
|
category: "Apps",
|
|
6010
6113
|
keys: ["SiteSearch"],
|
|
6011
6114
|
ssr: "prefetch",
|
|
6012
6115
|
settings: []
|
|
6013
|
-
},
|
|
6014
|
-
function
|
|
6116
|
+
}, Or = 50, kr = 2e3;
|
|
6117
|
+
function Ar() {
|
|
6015
6118
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
6016
6119
|
}
|
|
6017
|
-
function
|
|
6120
|
+
function jr(e, t) {
|
|
6018
6121
|
let n = e?.data ?? {}, r = [];
|
|
6019
6122
|
for (let e of Object.values(n)) {
|
|
6020
6123
|
let t = e == null ? "" : Oe(e);
|
|
6021
|
-
if (t && r.push(t), r.join(" ").length >
|
|
6124
|
+
if (t && r.push(t), r.join(" ").length > kr) break;
|
|
6022
6125
|
}
|
|
6023
|
-
return r.join(" ").slice(0,
|
|
6126
|
+
return r.join(" ").slice(0, kr).toLocaleLowerCase(t || void 0);
|
|
6024
6127
|
}
|
|
6025
|
-
function
|
|
6026
|
-
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";
|
|
6027
6130
|
i(() => {
|
|
6028
6131
|
let e = () => {
|
|
6029
|
-
let e =
|
|
6132
|
+
let e = Ar();
|
|
6030
6133
|
w(e), E(e);
|
|
6031
6134
|
};
|
|
6032
6135
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -6077,7 +6180,7 @@ function jr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6077
6180
|
});
|
|
6078
6181
|
}
|
|
6079
6182
|
else for (let t of e.rows) {
|
|
6080
|
-
if (!
|
|
6183
|
+
if (!jr(t, S).includes(P)) continue;
|
|
6081
6184
|
let n = t?.data ?? {}, r = Oe(n.name) || "Untitled", i = Oe(n.slug);
|
|
6082
6185
|
F.push({
|
|
6083
6186
|
key: `entry:${t.id}`,
|
|
@@ -6086,7 +6189,7 @@ function jr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6086
6189
|
kind: "entry"
|
|
6087
6190
|
});
|
|
6088
6191
|
}
|
|
6089
|
-
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) => {
|
|
6090
6193
|
if (v) {
|
|
6091
6194
|
e.preventDefault(), w(T), j(!0);
|
|
6092
6195
|
return;
|
|
@@ -6226,21 +6329,21 @@ function jr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6226
6329
|
}
|
|
6227
6330
|
//#endregion
|
|
6228
6331
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
6229
|
-
function
|
|
6332
|
+
function Nr(e) {
|
|
6230
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());
|
|
6231
6334
|
return [...new Set(n.map((e) => e.trim()))];
|
|
6232
6335
|
}
|
|
6233
|
-
var
|
|
6234
|
-
function
|
|
6336
|
+
var Pr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
6337
|
+
function Fr(e, t) {
|
|
6235
6338
|
let n = String(e ?? "").toUpperCase();
|
|
6236
6339
|
if (t === "code") return n;
|
|
6237
6340
|
let r = "";
|
|
6238
6341
|
try {
|
|
6239
|
-
r =
|
|
6342
|
+
r = Pr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
6240
6343
|
} catch {}
|
|
6241
6344
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
6242
6345
|
}
|
|
6243
|
-
function
|
|
6346
|
+
function Ir(e, t) {
|
|
6244
6347
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
6245
6348
|
if (typeof window > "u") return n || "?";
|
|
6246
6349
|
try {
|
|
@@ -6250,8 +6353,8 @@ function Fr(e, t) {
|
|
|
6250
6353
|
return n || "/";
|
|
6251
6354
|
}
|
|
6252
6355
|
}
|
|
6253
|
-
function
|
|
6254
|
-
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 = {
|
|
6255
6358
|
display: "inline-flex",
|
|
6256
6359
|
alignItems: "center",
|
|
6257
6360
|
gap: 8,
|
|
@@ -6286,7 +6389,7 @@ function Ir({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6286
6389
|
style: { opacity: .4 },
|
|
6287
6390
|
children: n ?? "·"
|
|
6288
6391
|
}), /* @__PURE__ */ u("a", {
|
|
6289
|
-
href:
|
|
6392
|
+
href: Ir(e, e === f),
|
|
6290
6393
|
hrefLang: e,
|
|
6291
6394
|
"aria-current": e === p ? "true" : void 0,
|
|
6292
6395
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -6296,7 +6399,7 @@ function Ir({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6296
6399
|
textDecoration: "none",
|
|
6297
6400
|
cursor: s ? "default" : "pointer"
|
|
6298
6401
|
},
|
|
6299
|
-
children:
|
|
6402
|
+
children: Fr(e, t)
|
|
6300
6403
|
})]
|
|
6301
6404
|
}, e))]
|
|
6302
6405
|
}) : /* @__PURE__ */ d("div", {
|
|
@@ -6307,7 +6410,7 @@ function Ir({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6307
6410
|
value: p,
|
|
6308
6411
|
onChange: s ? void 0 : (e) => {
|
|
6309
6412
|
let t = e.target.value;
|
|
6310
|
-
window.location.assign(
|
|
6413
|
+
window.location.assign(Ir(t, t === f));
|
|
6311
6414
|
},
|
|
6312
6415
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
6313
6416
|
style: {
|
|
@@ -6321,47 +6424,47 @@ function Ir({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6321
6424
|
},
|
|
6322
6425
|
children: l.map((e) => /* @__PURE__ */ u("option", {
|
|
6323
6426
|
value: e,
|
|
6324
|
-
children:
|
|
6427
|
+
children: Fr(e, t)
|
|
6325
6428
|
}, e))
|
|
6326
6429
|
})]
|
|
6327
6430
|
});
|
|
6328
6431
|
}
|
|
6329
6432
|
//#endregion
|
|
6330
6433
|
//#region ../ui/src/components/builder/apps/index.js
|
|
6331
|
-
var
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
],
|
|
6337
|
-
SiteLoginForm:
|
|
6338
|
-
SiteAccountMenu:
|
|
6339
|
-
SiteLanguagePicker:
|
|
6340
|
-
CookieConsent:
|
|
6341
|
-
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
|
|
6342
6445
|
};
|
|
6343
|
-
new Set(
|
|
6446
|
+
new Set(Rr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
6344
6447
|
//#endregion
|
|
6345
6448
|
//#region ../ui/src/components/builder/three/runtime.js
|
|
6346
|
-
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(
|
|
6347
6450
|
/* @vite-ignore */
|
|
6348
6451
|
/* webpackIgnore: true */
|
|
6349
6452
|
e
|
|
6350
|
-
),
|
|
6351
|
-
function
|
|
6352
|
-
if (
|
|
6453
|
+
), Kr = /* @__PURE__ */ new Map();
|
|
6454
|
+
function qr(e) {
|
|
6455
|
+
if (Kr.has(e)) return Kr.get(e);
|
|
6353
6456
|
if (typeof window > "u") return new Promise(() => {});
|
|
6354
|
-
let t =
|
|
6355
|
-
throw
|
|
6457
|
+
let t = Gr(e).catch((t) => {
|
|
6458
|
+
throw Kr.delete(e), t;
|
|
6356
6459
|
});
|
|
6357
|
-
return
|
|
6460
|
+
return Kr.set(e, t), t;
|
|
6358
6461
|
}
|
|
6359
|
-
var qr = () =>
|
|
6360
|
-
function
|
|
6361
|
-
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);
|
|
6362
6465
|
}
|
|
6363
|
-
var
|
|
6364
|
-
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) {
|
|
6365
6468
|
let n = 0, r = 0, i = 0, a = !0, o = (e) => {
|
|
6366
6469
|
n = requestAnimationFrame(o), i ||= e;
|
|
6367
6470
|
let a = r ? (e - r) / 1e3 : 0;
|
|
@@ -6380,7 +6483,7 @@ function Zr(e, t) {
|
|
|
6380
6483
|
s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
|
|
6381
6484
|
};
|
|
6382
6485
|
}
|
|
6383
|
-
function
|
|
6486
|
+
function ei(e, t, n = {}) {
|
|
6384
6487
|
let r = {
|
|
6385
6488
|
radius: n.distance ?? 4,
|
|
6386
6489
|
polar: n.polar ?? Math.PI / 2.4,
|
|
@@ -6429,13 +6532,13 @@ function Qr(e, t, n = {}) {
|
|
|
6429
6532
|
}
|
|
6430
6533
|
//#endregion
|
|
6431
6534
|
//#region ../ui/src/components/builder/three/views.jsx
|
|
6432
|
-
var
|
|
6433
|
-
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 }) {
|
|
6434
6537
|
return /* @__PURE__ */ d("div", {
|
|
6435
6538
|
ref: r,
|
|
6436
6539
|
style: {
|
|
6437
6540
|
...A(i),
|
|
6438
|
-
minHeight:
|
|
6541
|
+
minHeight: ti(n, 320),
|
|
6439
6542
|
display: "flex",
|
|
6440
6543
|
flexDirection: "column",
|
|
6441
6544
|
alignItems: "center",
|
|
@@ -6444,7 +6547,7 @@ function ni({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
6444
6547
|
border: "1px dashed rgba(148,163,184,.55)",
|
|
6445
6548
|
borderRadius: 10,
|
|
6446
6549
|
background: "rgba(148,163,184,.08)",
|
|
6447
|
-
...
|
|
6550
|
+
...K,
|
|
6448
6551
|
color: "rgba(100,116,139,.95)",
|
|
6449
6552
|
fontSize: 13,
|
|
6450
6553
|
textAlign: "center",
|
|
@@ -6463,25 +6566,24 @@ function ni({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
6463
6566
|
}) : null]
|
|
6464
6567
|
});
|
|
6465
6568
|
}
|
|
6466
|
-
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 }) {
|
|
6467
6570
|
let [y, b] = c(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = c(!1);
|
|
6468
6571
|
i(() => {
|
|
6469
6572
|
if (y || !e) return;
|
|
6470
6573
|
let t = !0;
|
|
6471
|
-
return
|
|
6574
|
+
return Xr().then(() => t && b(!0), () => t && S(!0)), () => {
|
|
6472
6575
|
t = !1;
|
|
6473
6576
|
};
|
|
6474
6577
|
}, [y, e]);
|
|
6475
6578
|
let C = {
|
|
6476
|
-
...A(g),
|
|
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 ri({ 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 ri({ 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 ii = ["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 ii = ["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 si(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,27 +6735,32 @@ function ci(e, t, n) {
|
|
|
6633
6735
|
}
|
|
6634
6736
|
return r;
|
|
6635
6737
|
}
|
|
6636
|
-
function
|
|
6637
|
-
let _ = s(null), v = s(null),
|
|
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 }) {
|
|
6739
|
+
let _ = s(null), v = s(null), y = s(null), [b, x] = c("");
|
|
6740
|
+
i(() => () => {
|
|
6741
|
+
let e = y.current;
|
|
6742
|
+
y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
|
|
6743
|
+
}, []);
|
|
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));
|
|
6638
6745
|
return i(() => {
|
|
6639
6746
|
let e = _.current, t = v.current;
|
|
6640
6747
|
if (!e || !t) return;
|
|
6641
|
-
let n = e.getContext("webgl", {
|
|
6748
|
+
let n = y.current ??= e.getContext("webgl", {
|
|
6642
6749
|
antialias: !0,
|
|
6643
6750
|
alpha: !0,
|
|
6644
6751
|
premultipliedAlpha: !1
|
|
6645
6752
|
});
|
|
6646
6753
|
if (!n) {
|
|
6647
|
-
|
|
6754
|
+
x("WebGL is not available in this browser");
|
|
6648
6755
|
return;
|
|
6649
6756
|
}
|
|
6650
6757
|
let r = null;
|
|
6651
6758
|
try {
|
|
6652
|
-
let e =
|
|
6759
|
+
let e = di(n, n.VERTEX_SHADER, si), t = di(n, n.FRAGMENT_SHADER, ci + S);
|
|
6653
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");
|
|
6654
|
-
|
|
6761
|
+
x("");
|
|
6655
6762
|
} catch (e) {
|
|
6656
|
-
|
|
6763
|
+
x(e?.message || "Shader failed to compile");
|
|
6657
6764
|
return;
|
|
6658
6765
|
}
|
|
6659
6766
|
n.useProgram(r);
|
|
@@ -6685,49 +6792,49 @@ function li({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
6685
6792
|
};
|
|
6686
6793
|
p !== !1 && t.addEventListener("pointermove", l);
|
|
6687
6794
|
let u = () => {
|
|
6688
|
-
let r =
|
|
6795
|
+
let r = Qr(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
|
|
6689
6796
|
(e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
|
|
6690
6797
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
6691
6798
|
d?.observe(t), u();
|
|
6692
|
-
let f =
|
|
6693
|
-
a:
|
|
6799
|
+
let f = Zr(), m = {
|
|
6800
|
+
a: ui(C, [
|
|
6694
6801
|
.35,
|
|
6695
6802
|
.4,
|
|
6696
6803
|
.95
|
|
6697
6804
|
]),
|
|
6698
|
-
b:
|
|
6805
|
+
b: ui(w, [
|
|
6699
6806
|
.05,
|
|
6700
6807
|
.06,
|
|
6701
6808
|
.16
|
|
6702
6809
|
]),
|
|
6703
|
-
c:
|
|
6810
|
+
c: ui(T, [
|
|
6704
6811
|
.95,
|
|
6705
6812
|
.35,
|
|
6706
6813
|
.6
|
|
6707
6814
|
])
|
|
6708
6815
|
}, h = {};
|
|
6709
|
-
return h.stop =
|
|
6710
|
-
u(), n.uniform2f(s.res, e.width, e.height), n.uniform1f(s.time, (f ? 0 : r) *
|
|
6816
|
+
return h.stop = $r(t, (t, r) => {
|
|
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?.();
|
|
6711
6818
|
}), () => {
|
|
6712
|
-
h.stop?.(), d?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i)
|
|
6819
|
+
h.stop?.(), d?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i);
|
|
6713
6820
|
};
|
|
6714
6821
|
}, [
|
|
6715
|
-
x,
|
|
6716
6822
|
S,
|
|
6717
6823
|
C,
|
|
6718
6824
|
w,
|
|
6719
6825
|
T,
|
|
6720
6826
|
E,
|
|
6827
|
+
D,
|
|
6721
6828
|
p
|
|
6722
6829
|
]), /* @__PURE__ */ d("div", {
|
|
6723
6830
|
ref: (e) => {
|
|
6724
6831
|
v.current = e, typeof h == "function" && h(e);
|
|
6725
6832
|
},
|
|
6726
6833
|
style: {
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6834
|
+
position: "relative",
|
|
6835
|
+
minHeight: ti(f, 320),
|
|
6836
|
+
overflow: "hidden",
|
|
6837
|
+
...A(m)
|
|
6731
6838
|
},
|
|
6732
6839
|
children: [/* @__PURE__ */ u("canvas", {
|
|
6733
6840
|
ref: _,
|
|
@@ -6738,7 +6845,7 @@ function li({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
6738
6845
|
position: "absolute",
|
|
6739
6846
|
inset: 0
|
|
6740
6847
|
}
|
|
6741
|
-
}),
|
|
6848
|
+
}), b && g ? /* @__PURE__ */ u("div", {
|
|
6742
6849
|
style: {
|
|
6743
6850
|
position: "absolute",
|
|
6744
6851
|
inset: 0,
|
|
@@ -6747,17 +6854,17 @@ function li({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
6747
6854
|
justifyContent: "center",
|
|
6748
6855
|
padding: 12,
|
|
6749
6856
|
background: "rgba(15,23,42,.75)",
|
|
6750
|
-
...
|
|
6857
|
+
...K,
|
|
6751
6858
|
color: "#fecaca",
|
|
6752
6859
|
fontSize: 11,
|
|
6753
6860
|
whiteSpace: "pre-wrap",
|
|
6754
6861
|
overflow: "auto"
|
|
6755
6862
|
},
|
|
6756
|
-
children:
|
|
6863
|
+
children: b
|
|
6757
6864
|
}) : null]
|
|
6758
6865
|
});
|
|
6759
6866
|
}
|
|
6760
|
-
function
|
|
6867
|
+
function pi(e, t) {
|
|
6761
6868
|
let n = new e.Scene(), r = new e.BoxGeometry();
|
|
6762
6869
|
r.deleteAttribute("uv");
|
|
6763
6870
|
let i = new e.Mesh(r, new e.MeshBasicMaterial({
|
|
@@ -6773,7 +6880,23 @@ function ui(e, t) {
|
|
|
6773
6880
|
let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
|
|
6774
6881
|
return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
|
|
6775
6882
|
}
|
|
6776
|
-
var
|
|
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) => {
|
|
6887
|
+
new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
|
|
6888
|
+
})).catch((t) => {
|
|
6889
|
+
throw mi.delete(e), t;
|
|
6890
|
+
});
|
|
6891
|
+
return mi.set(e, t), t;
|
|
6892
|
+
}
|
|
6893
|
+
function gi(e, t) {
|
|
6894
|
+
let n = new e.Box3().setFromObject(t);
|
|
6895
|
+
if (n.isEmpty()) return t;
|
|
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();
|
|
6897
|
+
return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
|
|
6898
|
+
}
|
|
6899
|
+
var _i = {
|
|
6777
6900
|
box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
|
|
6778
6901
|
sphere: (e) => new e.SphereGeometry(.62, 48, 32),
|
|
6779
6902
|
torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
|
|
@@ -6782,59 +6905,74 @@ var di = {
|
|
|
6782
6905
|
cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
|
|
6783
6906
|
plane: (e) => new e.PlaneGeometry(1.4, 1.4),
|
|
6784
6907
|
capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
|
|
6785
|
-
},
|
|
6786
|
-
function
|
|
6787
|
-
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;
|
|
6788
6911
|
return i(() => {
|
|
6789
6912
|
let e = g.current;
|
|
6790
6913
|
if (!e) return;
|
|
6791
6914
|
let i = !0, a = null;
|
|
6792
|
-
return
|
|
6915
|
+
return Jr().then((s) => {
|
|
6793
6916
|
if (!i || !e) return;
|
|
6794
6917
|
let c = new s.WebGLRenderer({
|
|
6795
6918
|
antialias: !0,
|
|
6796
6919
|
alpha: !t
|
|
6797
6920
|
});
|
|
6798
|
-
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);
|
|
6799
6922
|
let l = new s.Scene();
|
|
6800
|
-
t && (l.background = new s.Color(t)), l.environment =
|
|
6801
|
-
let u = new s.PerspectiveCamera(
|
|
6802
|
-
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),
|
|
6803
6926
|
enableZoom: S
|
|
6804
6927
|
}), p = new s.DirectionalLight(16777215, 2.2);
|
|
6805
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));
|
|
6806
|
-
let m = [], h = new s.Group()
|
|
6929
|
+
let m = [], h = new s.Group(), g = (e, t) => {
|
|
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);
|
|
6932
|
+
};
|
|
6807
6933
|
for (let e of y) {
|
|
6808
|
-
|
|
6934
|
+
if (e.shape === "model") {
|
|
6935
|
+
if (!ii(e.src)) continue;
|
|
6936
|
+
let t = new s.Group();
|
|
6937
|
+
g(t, e), h.add(t), hi(e.src).then((e) => {
|
|
6938
|
+
if (!i) return;
|
|
6939
|
+
let n = gi(s, e.clone(!0));
|
|
6940
|
+
n.traverse((e) => {
|
|
6941
|
+
e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
|
|
6942
|
+
}), t.add(n);
|
|
6943
|
+
}, () => {});
|
|
6944
|
+
continue;
|
|
6945
|
+
}
|
|
6946
|
+
let t = (_i[e.shape] ?? _i.box)(s), n = new s.MeshStandardMaterial({
|
|
6809
6947
|
color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
|
|
6810
|
-
metalness: Math.min(1, Math.max(0,
|
|
6811
|
-
roughness: Math.min(1, Math.max(0,
|
|
6812
|
-
transparent:
|
|
6813
|
-
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))),
|
|
6814
6952
|
flatShading: e.flat === !0,
|
|
6815
6953
|
wireframe: e.wireframe === !0,
|
|
6816
6954
|
side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
|
|
6817
|
-
}), r = new s.Mesh(t, n)
|
|
6818
|
-
|
|
6955
|
+
}), r = new s.Mesh(t, n);
|
|
6956
|
+
g(r, e), r.castShadow = !0, r.receiveShadow = !0, h.add(r), m.push(t, n);
|
|
6819
6957
|
}
|
|
6820
6958
|
l.add(h);
|
|
6821
|
-
let
|
|
6959
|
+
let _ = null;
|
|
6822
6960
|
if (d !== !1) {
|
|
6823
6961
|
let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
|
|
6824
|
-
|
|
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);
|
|
6825
6963
|
}
|
|
6826
|
-
let
|
|
6964
|
+
let v = () => {
|
|
6827
6965
|
let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
|
|
6828
6966
|
c.setSize(t, n, !1), u.aspect = t / n, u.updateProjectionMatrix();
|
|
6829
|
-
},
|
|
6830
|
-
|
|
6831
|
-
let
|
|
6832
|
-
f.autoSpin(x ?
|
|
6967
|
+
}, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
|
|
6968
|
+
b?.observe(e), v();
|
|
6969
|
+
let C = ri(Number.isFinite(Number(o)) ? o : 20), w = $r(e, (e) => {
|
|
6970
|
+
f.autoSpin(x ? C : 0, e), f.update();
|
|
6833
6971
|
for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
|
|
6834
6972
|
c.render(l, u);
|
|
6835
6973
|
});
|
|
6836
6974
|
a = () => {
|
|
6837
|
-
|
|
6975
|
+
w(), b?.disconnect(), f.dispose();
|
|
6838
6976
|
for (let e of m) e.dispose?.();
|
|
6839
6977
|
l.environment?.dispose?.(), c.dispose(), c.domElement.remove();
|
|
6840
6978
|
};
|
|
@@ -6852,7 +6990,7 @@ function pi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
6852
6990
|
o,
|
|
6853
6991
|
S,
|
|
6854
6992
|
d
|
|
6855
|
-
]), _ && h ? /* @__PURE__ */ u(
|
|
6993
|
+
]), _ && h ? /* @__PURE__ */ u(ai, {
|
|
6856
6994
|
nodeRef: m,
|
|
6857
6995
|
style: p,
|
|
6858
6996
|
height: f,
|
|
@@ -6863,27 +7001,27 @@ function pi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
6863
7001
|
g.current = e, typeof m == "function" && m(e);
|
|
6864
7002
|
},
|
|
6865
7003
|
style: {
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
height: $r(f, 380),
|
|
7004
|
+
minHeight: ti(f, 380),
|
|
7005
|
+
height: ti(f, 380),
|
|
6869
7006
|
overflow: "hidden",
|
|
6870
|
-
touchAction: S ? "pan-y" : void 0
|
|
7007
|
+
touchAction: S ? "pan-y" : void 0,
|
|
7008
|
+
...A(p)
|
|
6871
7009
|
}
|
|
6872
7010
|
});
|
|
6873
7011
|
}
|
|
6874
|
-
function
|
|
7012
|
+
function bi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o }) {
|
|
6875
7013
|
let l = s(null), [d, f] = c("");
|
|
6876
7014
|
return i(() => {
|
|
6877
7015
|
let t = l.current;
|
|
6878
7016
|
if (o || !t || typeof e != "string" || !e.trim()) return;
|
|
6879
7017
|
let r = !0, i = null;
|
|
6880
|
-
return
|
|
7018
|
+
return Jr().then((a) => {
|
|
6881
7019
|
if (!r || !t) return;
|
|
6882
7020
|
let o = new a.WebGLRenderer({
|
|
6883
7021
|
antialias: !0,
|
|
6884
7022
|
alpha: !n
|
|
6885
7023
|
});
|
|
6886
|
-
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);
|
|
6887
7025
|
let s = new a.Scene();
|
|
6888
7026
|
n && (s.background = new a.Color(n));
|
|
6889
7027
|
let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
|
|
@@ -6906,7 +7044,7 @@ function mi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
6906
7044
|
o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
|
|
6907
7045
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
6908
7046
|
d?.observe(t), u();
|
|
6909
|
-
let p = !1, m =
|
|
7047
|
+
let p = !1, m = $r(t, (e, t) => {
|
|
6910
7048
|
if (!p && typeof l?.frame == "function") try {
|
|
6911
7049
|
l.frame(e, t);
|
|
6912
7050
|
} catch (e) {
|
|
@@ -6928,7 +7066,7 @@ function mi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
6928
7066
|
e,
|
|
6929
7067
|
o,
|
|
6930
7068
|
n
|
|
6931
|
-
]), o ? /* @__PURE__ */ u(
|
|
7069
|
+
]), o ? /* @__PURE__ */ u(ai, {
|
|
6932
7070
|
nodeRef: a,
|
|
6933
7071
|
style: r,
|
|
6934
7072
|
height: t,
|
|
@@ -6939,12 +7077,12 @@ function mi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
6939
7077
|
l.current = e, typeof a == "function" && a(e);
|
|
6940
7078
|
},
|
|
6941
7079
|
style: {
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
height: $r(t, 380),
|
|
7080
|
+
minHeight: ti(t, 380),
|
|
7081
|
+
height: ti(t, 380),
|
|
6945
7082
|
overflow: "hidden",
|
|
6946
7083
|
position: "relative",
|
|
6947
|
-
touchAction: "pan-y"
|
|
7084
|
+
touchAction: "pan-y",
|
|
7085
|
+
...A(r)
|
|
6948
7086
|
},
|
|
6949
7087
|
children: d ? /* @__PURE__ */ u("div", {
|
|
6950
7088
|
style: {
|
|
@@ -6955,7 +7093,7 @@ function mi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
6955
7093
|
padding: "6px 8px",
|
|
6956
7094
|
borderRadius: 6,
|
|
6957
7095
|
background: "rgba(127,29,29,.85)",
|
|
6958
|
-
...
|
|
7096
|
+
...K,
|
|
6959
7097
|
color: "#fee2e2",
|
|
6960
7098
|
fontSize: 11
|
|
6961
7099
|
},
|
|
@@ -6963,40 +7101,40 @@ function mi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
6963
7101
|
}) : null
|
|
6964
7102
|
});
|
|
6965
7103
|
}
|
|
6966
|
-
var
|
|
6967
|
-
ModelViewerBlock:
|
|
6968
|
-
ShaderBlock:
|
|
6969
|
-
SceneBlock:
|
|
6970
|
-
ThreeCanvasBlock:
|
|
6971
|
-
},
|
|
6972
|
-
function
|
|
6973
|
-
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);
|
|
6974
7112
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
6975
7113
|
/* @vite-ignore */
|
|
6976
7114
|
/* webpackIgnore: true */
|
|
6977
7115
|
t
|
|
6978
7116
|
).finally(() => URL.revokeObjectURL(t));
|
|
6979
|
-
return
|
|
7117
|
+
return Si.set(e, n), n;
|
|
6980
7118
|
}
|
|
6981
|
-
function
|
|
7119
|
+
function wi(e) {
|
|
6982
7120
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
6983
7121
|
return n && typeof n == "object" ? n : {};
|
|
6984
7122
|
}
|
|
6985
7123
|
//#endregion
|
|
6986
7124
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
6987
|
-
async function
|
|
6988
|
-
let n = await
|
|
7125
|
+
async function Ti(e, t) {
|
|
7126
|
+
let n = await Ci(e);
|
|
6989
7127
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
6990
7128
|
}
|
|
6991
|
-
var
|
|
7129
|
+
var Ei = {
|
|
6992
7130
|
padding: "10px 12px",
|
|
6993
7131
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
6994
7132
|
borderRadius: 8,
|
|
6995
7133
|
fontSize: 12,
|
|
6996
7134
|
opacity: .6
|
|
6997
7135
|
};
|
|
6998
|
-
function
|
|
6999
|
-
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 = {
|
|
7000
7138
|
tenant: c?.tenant ?? "",
|
|
7001
7139
|
apiUrl: c?.apiUrl ?? "/api",
|
|
7002
7140
|
locale: c?.locale ?? "",
|
|
@@ -7008,7 +7146,7 @@ function xi({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
7008
7146
|
let e = f.current;
|
|
7009
7147
|
if (!l?.code || !e) return;
|
|
7010
7148
|
let n = !0;
|
|
7011
|
-
return
|
|
7149
|
+
return Ti(l.code, t).then((e) => {
|
|
7012
7150
|
if (!(!n || !e || !f.current)) {
|
|
7013
7151
|
p.current = e;
|
|
7014
7152
|
try {
|
|
@@ -7038,7 +7176,7 @@ function xi({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
7038
7176
|
}) : /* @__PURE__ */ d("div", {
|
|
7039
7177
|
ref: o,
|
|
7040
7178
|
style: {
|
|
7041
|
-
...
|
|
7179
|
+
...Ei,
|
|
7042
7180
|
...A(a)
|
|
7043
7181
|
},
|
|
7044
7182
|
children: [
|
|
@@ -7050,13 +7188,13 @@ function xi({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
7050
7188
|
}
|
|
7051
7189
|
//#endregion
|
|
7052
7190
|
//#region ../ui/src/components/builder/render.jsx
|
|
7053
|
-
var
|
|
7054
|
-
...
|
|
7055
|
-
...
|
|
7056
|
-
...
|
|
7057
|
-
PluginBlock:
|
|
7191
|
+
var Oi = {
|
|
7192
|
+
...or,
|
|
7193
|
+
...zr,
|
|
7194
|
+
...xi,
|
|
7195
|
+
PluginBlock: Di
|
|
7058
7196
|
};
|
|
7059
|
-
function
|
|
7197
|
+
function ki(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
7060
7198
|
let o = n[t];
|
|
7061
7199
|
if (!o || o.hidden) return null;
|
|
7062
7200
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -7064,11 +7202,11 @@ function Ci(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7064
7202
|
let n = o.props?.componentId, s = r?.[n];
|
|
7065
7203
|
if (!s?.template || i.has(n)) return null;
|
|
7066
7204
|
let c = new Set(i).add(n);
|
|
7067
|
-
return /* @__PURE__ */ u(e, { children:
|
|
7205
|
+
return /* @__PURE__ */ u(e, { children: ki(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
7068
7206
|
}
|
|
7069
|
-
let l =
|
|
7207
|
+
let l = Oi[s];
|
|
7070
7208
|
if (!l) return null;
|
|
7071
|
-
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, {
|
|
7072
7210
|
...c,
|
|
7073
7211
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
7074
7212
|
linked: p,
|
|
@@ -7077,16 +7215,16 @@ function Ci(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7077
7215
|
},
|
|
7078
7216
|
children: d.length ? d : void 0
|
|
7079
7217
|
}, t);
|
|
7080
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ u(
|
|
7218
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ u(gr, {
|
|
7081
7219
|
when: c.when,
|
|
7082
7220
|
children: m
|
|
7083
7221
|
}, t) : m;
|
|
7084
7222
|
}
|
|
7085
7223
|
//#endregion
|
|
7086
7224
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
7087
|
-
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(" ")} }
|
|
7088
7226
|
.webim-page[data-webim-mode="dark"] { ${Object.entries(ue(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
7089
|
-
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 }) {
|
|
7090
7228
|
let b = s?.js?.trim();
|
|
7091
7229
|
if (i(() => {
|
|
7092
7230
|
if (!b) return;
|
|
@@ -7100,11 +7238,11 @@ function Ei({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7100
7238
|
minHeight: "100%",
|
|
7101
7239
|
display: "flex",
|
|
7102
7240
|
flexDirection: "column"
|
|
7103
|
-
}, 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", {
|
|
7104
7242
|
rel: "stylesheet",
|
|
7105
7243
|
precedence: "default",
|
|
7106
7244
|
href: g(e)
|
|
7107
|
-
}, e)), P =
|
|
7245
|
+
}, e)), P = ji(j);
|
|
7108
7246
|
return r === "auto" ? /* @__PURE__ */ u(Z.Provider, {
|
|
7109
7247
|
value: {
|
|
7110
7248
|
tenant: l || "",
|
|
@@ -7112,7 +7250,7 @@ function Ei({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7112
7250
|
locale: m || "",
|
|
7113
7251
|
settings: _ ?? null
|
|
7114
7252
|
},
|
|
7115
|
-
children: /* @__PURE__ */ u(
|
|
7253
|
+
children: /* @__PURE__ */ u(hr, {
|
|
7116
7254
|
initialUser: v,
|
|
7117
7255
|
children: /* @__PURE__ */ u(xe.Provider, {
|
|
7118
7256
|
value: p ?? null,
|
|
@@ -7127,8 +7265,8 @@ function Ei({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7127
7265
|
...a
|
|
7128
7266
|
},
|
|
7129
7267
|
children: [
|
|
7130
|
-
/* @__PURE__ */ u("style", { children: `.webim-page { ${
|
|
7131
|
-
@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))} } }` }),
|
|
7132
7270
|
/* @__PURE__ */ u("style", { children: P }),
|
|
7133
7271
|
N,
|
|
7134
7272
|
/* @__PURE__ */ u("style", { children: S }),
|
|
@@ -7148,7 +7286,7 @@ function Ei({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7148
7286
|
locale: m || "",
|
|
7149
7287
|
settings: _ ?? null
|
|
7150
7288
|
},
|
|
7151
|
-
children: /* @__PURE__ */ u(
|
|
7289
|
+
children: /* @__PURE__ */ u(hr, {
|
|
7152
7290
|
initialUser: v,
|
|
7153
7291
|
children: /* @__PURE__ */ u(xe.Provider, {
|
|
7154
7292
|
value: p ?? null,
|
|
@@ -7181,8 +7319,8 @@ function Ei({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7181
7319
|
}
|
|
7182
7320
|
//#endregion
|
|
7183
7321
|
//#region src/WebimContent.jsx
|
|
7184
|
-
function
|
|
7185
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ u(
|
|
7322
|
+
function Ni({ bundle: e, mode: t = "auto", style: n }) {
|
|
7323
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(Mi, {
|
|
7186
7324
|
blocks: e.blocks,
|
|
7187
7325
|
theme: e.theme,
|
|
7188
7326
|
components: e.components,
|
|
@@ -7200,7 +7338,7 @@ function Di({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
7200
7338
|
}
|
|
7201
7339
|
//#endregion
|
|
7202
7340
|
//#region src/WebimPage.jsx
|
|
7203
|
-
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 }) {
|
|
7204
7342
|
let [g, _] = c({ status: "loading" }), v = s({
|
|
7205
7343
|
onLoad: m,
|
|
7206
7344
|
onError: h
|
|
@@ -7237,11 +7375,11 @@ function Oi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
7237
7375
|
r,
|
|
7238
7376
|
a,
|
|
7239
7377
|
o
|
|
7240
|
-
]), 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, {
|
|
7241
7379
|
bundle: g.bundle,
|
|
7242
7380
|
mode: l,
|
|
7243
7381
|
style: d
|
|
7244
7382
|
});
|
|
7245
7383
|
}
|
|
7246
7384
|
//#endregion
|
|
7247
|
-
export {
|
|
7385
|
+
export { Mi as PageRenderer, Ni as WebimContent, Pi as WebimPage, ye as fetchPage, Ze as renderRichContent, he as resolveTheme };
|