webim-adapter 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/build/webim-adapter.js +1186 -738
- package/build/webim-embed.js +16 -10
- package/build/webim-ssr.js +1261 -813
- package/package.json +1 -1
package/build/webim-ssr.js
CHANGED
|
@@ -269,26 +269,26 @@ function P(e) {
|
|
|
269
269
|
delete t.textStrokeWidth, delete t.textStrokeColor, (W !== void 0 || te !== void 0) && (t.WebkitTextStroke = `${M(W ?? 1)} ${te || "currentColor"}`);
|
|
270
270
|
let { clipText: ne } = t;
|
|
271
271
|
delete t.clipText, ne && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
272
|
-
let { transitions:
|
|
272
|
+
let { transitions: G, transitionDuration: K, transitionEasing: re, transitionProperty: q } = t, ie = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
273
273
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
274
|
-
let
|
|
275
|
-
if (
|
|
274
|
+
let ae = (Array.isArray(G) ? G : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ie(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
275
|
+
if (K !== void 0 && ae.push(`${q || "all"} ${ie(K)} ${re || "ease"}`), ae.length && (t.transition = ae.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
276
276
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
277
277
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
278
278
|
}
|
|
279
279
|
delete t.backgroundVideo;
|
|
280
|
-
let { overlayColor:
|
|
281
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
282
|
-
let e = `color-mix(in srgb, ${
|
|
280
|
+
let { overlayColor: J, overlayOpacity: oe } = t;
|
|
281
|
+
if (delete t.overlayColor, delete t.overlayOpacity, J) {
|
|
282
|
+
let e = `color-mix(in srgb, ${J} ${oe ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
283
283
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
284
284
|
}
|
|
285
285
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
286
|
-
let { backgroundLayers:
|
|
286
|
+
let { backgroundLayers: se } = t;
|
|
287
287
|
delete t.backgroundLayers;
|
|
288
|
-
let
|
|
289
|
-
if (
|
|
288
|
+
let ce = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1);
|
|
289
|
+
if (ce.length) {
|
|
290
290
|
let e = [], n = [], r = [], i = [], a = [];
|
|
291
|
-
for (let t of
|
|
291
|
+
for (let t of ce) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
292
292
|
else if (t.kind === "radial") e.push(`radial-gradient(circle, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
293
293
|
else {
|
|
294
294
|
if (!t.src) continue;
|
|
@@ -385,10 +385,10 @@ function ne(e, t, n, r = !1) {
|
|
|
385
385
|
let i = Object.entries(P(t)).map(([e, t]) => `${te(e)}: ${t} !important;`).join(" ");
|
|
386
386
|
return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function G(e, t, n) {
|
|
389
389
|
return Object.entries(F).map(([r, i]) => ne(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
390
390
|
}
|
|
391
|
-
var
|
|
391
|
+
var K = [
|
|
392
392
|
{
|
|
393
393
|
key: "tablet",
|
|
394
394
|
max: 991
|
|
@@ -401,17 +401,17 @@ var G = [
|
|
|
401
401
|
key: "mobile",
|
|
402
402
|
max: 478
|
|
403
403
|
}
|
|
404
|
-
],
|
|
405
|
-
function
|
|
406
|
-
return
|
|
407
|
-
let i = t?.[n] ?
|
|
404
|
+
], re = (e) => Object.entries(P(e)).map(([e, t]) => `${te(e)}: ${t} !important;`).join(" ");
|
|
405
|
+
function q(e, t) {
|
|
406
|
+
return K.map(({ key: n, max: r }) => {
|
|
407
|
+
let i = t?.[n] ? re(t[n]) : "";
|
|
408
408
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
409
409
|
}).filter(Boolean).join("\n");
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function ie(e, t) {
|
|
412
412
|
let n = [], r = (e) => {
|
|
413
413
|
for (let [t, r] of Object.entries(e || {})) {
|
|
414
|
-
let e =
|
|
414
|
+
let e = q(t, r.props);
|
|
415
415
|
e && n.push(e);
|
|
416
416
|
}
|
|
417
417
|
};
|
|
@@ -419,10 +419,10 @@ function oe(e, t) {
|
|
|
419
419
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
420
420
|
return n.join("\n");
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function ae(e, t) {
|
|
423
423
|
let n = [], r = (e) => {
|
|
424
424
|
for (let [t, r] of Object.entries(e || {})) {
|
|
425
|
-
let e =
|
|
425
|
+
let e = G(t, r.props);
|
|
426
426
|
e && n.push(e);
|
|
427
427
|
}
|
|
428
428
|
};
|
|
@@ -430,15 +430,282 @@ function se(e, t) {
|
|
|
430
430
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
431
431
|
return n.join("\n");
|
|
432
432
|
}
|
|
433
|
-
var
|
|
434
|
-
fontFamily:
|
|
433
|
+
var J = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", oe = {
|
|
434
|
+
fontFamily: J,
|
|
435
435
|
fontStyle: "normal",
|
|
436
436
|
fontWeight: 400,
|
|
437
437
|
letterSpacing: "normal",
|
|
438
438
|
textTransform: "none",
|
|
439
439
|
lineHeight: 1.4,
|
|
440
440
|
textShadow: "none"
|
|
441
|
-
},
|
|
441
|
+
}, se = /^(https?:|mailto:|tel:)/i, ce = /^[a-z][a-z0-9+.-]*:/i;
|
|
442
|
+
function le(e) {
|
|
443
|
+
let t = String(e ?? "").trim();
|
|
444
|
+
return t ? se.test(t) || t.startsWith("//") ? t : ce.test(t) ? "" : t : "";
|
|
445
|
+
}
|
|
446
|
+
var ue = /^\\([\\`*_{}[\]()#+\-.!~>|])/, de = /^(`+)([\s\S]*?[^`])\1(?!`)/, fe = /^!\[([^\]]*)\]\(\s*<?([^)\s>]*)>?(?:\s+"([^"]*)")?\s*\)/, pe = /^\[((?:[^[\]]|\[[^\]]*\])*)\]\(\s*<?([^)\s>]*)>?(?:\s+"([^"]*)")?\s*\)/, me = /^<((?:https?:\/\/|mailto:)[^>\s]+)>/, he = /^https?:\/\/[^\s<>"'`]+[^\s<>"'`.,;:!?)\]}]/, ge = /^(\*\*|__)(?=\S)([\s\S]*?\S)\1/, _e = /^~~(?=\S)([\s\S]*?\S)~~/, ve = /^(\*|_)(?=\S)([\s\S]*?\S)\1/, ye = /[\\`*_~![<\n]|https?:\/\//, be = (e, t) => e.map((e) => e.br || e.image ? {
|
|
447
|
+
...e,
|
|
448
|
+
...t.href ? {
|
|
449
|
+
href: t.href,
|
|
450
|
+
target: t.target
|
|
451
|
+
} : null
|
|
452
|
+
} : {
|
|
453
|
+
...e,
|
|
454
|
+
...t
|
|
455
|
+
});
|
|
456
|
+
function Y(e, t = {}) {
|
|
457
|
+
let n = String(e ?? ""), r = t.newTab ? "_blank" : void 0, i = [], a = "", o = 0, s = () => {
|
|
458
|
+
a && i.push({ text: a }), a = "";
|
|
459
|
+
}, c = (e) => {
|
|
460
|
+
s(), i.push(...e);
|
|
461
|
+
};
|
|
462
|
+
for (; o < n.length;) {
|
|
463
|
+
let e = n.slice(o), i = o > 0 ? n[o - 1] : "", s = ue.exec(e);
|
|
464
|
+
if (s) {
|
|
465
|
+
a += s[1], o += s[0].length;
|
|
466
|
+
continue;
|
|
467
|
+
}
|
|
468
|
+
if (e[0] === "\n") {
|
|
469
|
+
/ {2,}$/.test(a) ? (a = a.replace(/ +$/, ""), c([{ br: !0 }])) : a.endsWith("\\") ? (a = a.slice(0, -1), c([{ br: !0 }])) : a += " ", o += 1;
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
if (s = de.exec(e), s) {
|
|
473
|
+
c([{
|
|
474
|
+
text: (/^ .* $/.test(s[2]) ? s[2].slice(1, -1) : s[2]).replace(/\n/g, " "),
|
|
475
|
+
code: !0
|
|
476
|
+
}]), o += s[0].length;
|
|
477
|
+
continue;
|
|
478
|
+
}
|
|
479
|
+
if (s = fe.exec(e), s) {
|
|
480
|
+
let e = le(s[2]);
|
|
481
|
+
e ? c([{ image: {
|
|
482
|
+
src: e,
|
|
483
|
+
alt: s[1] || "",
|
|
484
|
+
title: s[3] || ""
|
|
485
|
+
} }]) : a += s[1], o += s[0].length;
|
|
486
|
+
continue;
|
|
487
|
+
}
|
|
488
|
+
if (s = pe.exec(e), s) {
|
|
489
|
+
let e = le(s[2]), n = Y(s[1], t);
|
|
490
|
+
c(e ? be(n, {
|
|
491
|
+
href: e,
|
|
492
|
+
target: r
|
|
493
|
+
}) : n), o += s[0].length;
|
|
494
|
+
continue;
|
|
495
|
+
}
|
|
496
|
+
if (s = me.exec(e) ?? (/[\s(<]/.test(i) || o === 0 ? he.exec(e) : null), s) {
|
|
497
|
+
let e = s[1] ?? s[0], t = le(e);
|
|
498
|
+
t ? c([{
|
|
499
|
+
text: e.replace(/^mailto:/i, ""),
|
|
500
|
+
href: t,
|
|
501
|
+
target: r
|
|
502
|
+
}]) : a += e, o += s[0].length;
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
if (s = ge.exec(e), s && (s[1] === "**" || !/\w/.test(i))) {
|
|
506
|
+
c(be(Y(s[2], t), { bold: !0 })), o += s[0].length;
|
|
507
|
+
continue;
|
|
508
|
+
}
|
|
509
|
+
if (s = _e.exec(e), s) {
|
|
510
|
+
c(be(Y(s[1], t), { strike: !0 })), o += s[0].length;
|
|
511
|
+
continue;
|
|
512
|
+
}
|
|
513
|
+
if (s = ve.exec(e), s && (s[1] === "*" || !/\w/.test(i) && !/\w/.test(n[o + s[0].length] ?? ""))) {
|
|
514
|
+
c(be(Y(s[2], t), { italic: !0 })), o += s[0].length;
|
|
515
|
+
continue;
|
|
516
|
+
}
|
|
517
|
+
a += n[o], o += 1;
|
|
518
|
+
let l = n.slice(o).search(ye);
|
|
519
|
+
l > 0 ? (a += n.slice(o, o + l), o += l) : l === -1 && (a += n.slice(o), o = n.length);
|
|
520
|
+
}
|
|
521
|
+
return s(), i;
|
|
522
|
+
}
|
|
523
|
+
var X = /^[ \t]*$/, Z = /^ {0,3}(`{3,}|~{3,})[ \t]*([^`\s]*)[ \t]*$/, xe = /^ {0,3}(#{1,6})(?:[ \t]+(.*?))?[ \t]*$/, Se = /^ {0,3}(?:(?:\*[ \t]*){3,}|(?:-[ \t]*){3,}|(?:_[ \t]*){3,})$/, Ce = /^ {0,3}>[ \t]?(.*)$/, we = /^( *)([-*+])[ \t]+(.*)$/, Te = /^( *)(\d{1,9})[.)][ \t]+(.*)$/, Ee = /^ {0,3}(=+|-+)[ \t]*$/, De = /^\[([ xX])\][ \t]+(.*)$/, Oe = /^ {0,3}\|?(?:[ \t]*:?-+:?[ \t]*\|)+[ \t]*:?-*:?[ \t]*\|?[ \t]*$/, ke = (e) => (/^[ \t]*/.exec(e)[0].match(/\t/g) || []).length * 3 + /^[ \t]*/.exec(e)[0].length;
|
|
524
|
+
function Ae(e) {
|
|
525
|
+
let t = we.exec(e);
|
|
526
|
+
if (t) return {
|
|
527
|
+
indent: t[1].length,
|
|
528
|
+
ordered: !1,
|
|
529
|
+
text: t[3]
|
|
530
|
+
};
|
|
531
|
+
let n = Te.exec(e);
|
|
532
|
+
return n ? {
|
|
533
|
+
indent: n[1].length,
|
|
534
|
+
ordered: !0,
|
|
535
|
+
start: Number(n[2]),
|
|
536
|
+
text: n[3]
|
|
537
|
+
} : null;
|
|
538
|
+
}
|
|
539
|
+
function je(e) {
|
|
540
|
+
let t = [], n = "";
|
|
541
|
+
for (let r = 0; r < e.length; r++) e[r] === "\\" && e[r + 1] === "|" ? (n += "|", r += 1) : e[r] === "|" ? (t.push(n), n = "") : n += e[r];
|
|
542
|
+
return t.push(n), t.length && X.test(t[0]) && t.shift(), t.length && X.test(t[t.length - 1]) && t.pop(), t.map((e) => e.trim());
|
|
543
|
+
}
|
|
544
|
+
var Me = (e) => {
|
|
545
|
+
let t = e.trim(), n = t.startsWith(":"), r = t.endsWith(":");
|
|
546
|
+
return n && r ? "center" : r ? "right" : n ? "left" : null;
|
|
547
|
+
};
|
|
548
|
+
function Ne(e) {
|
|
549
|
+
let t = e.filter((e) => !(e.text && !e.text.trim()));
|
|
550
|
+
if (t.length === 1 && t[0].image && !t[0].href) {
|
|
551
|
+
let { src: e, alt: n, title: r } = t[0].image;
|
|
552
|
+
return [{
|
|
553
|
+
type: "image",
|
|
554
|
+
src: e,
|
|
555
|
+
alt: n,
|
|
556
|
+
caption: r || "",
|
|
557
|
+
align: "left",
|
|
558
|
+
wrap: !1
|
|
559
|
+
}];
|
|
560
|
+
}
|
|
561
|
+
return e.length ? [{
|
|
562
|
+
type: "p",
|
|
563
|
+
parts: e
|
|
564
|
+
}] : [];
|
|
565
|
+
}
|
|
566
|
+
function Pe(e) {
|
|
567
|
+
let t = String(e ?? "").replace(/\r\n?/g, "\n").replace(/^/, "").split("\n"), n = null;
|
|
568
|
+
return t.map((e) => {
|
|
569
|
+
let t = Z.exec(e);
|
|
570
|
+
return n ? (t && t[1].startsWith(n[0]) && t[1].length >= n.length && (n = null), e) : t ? (n = t[1], e) : e.replace(/^[ \t]+/, (e) => e.replace(/\t/g, " "));
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
function Fe(e, t) {
|
|
574
|
+
let n = [], r = 0;
|
|
575
|
+
for (; r < e.length;) {
|
|
576
|
+
let i = e[r];
|
|
577
|
+
if (X.test(i)) {
|
|
578
|
+
r += 1;
|
|
579
|
+
continue;
|
|
580
|
+
}
|
|
581
|
+
let a = Z.exec(i);
|
|
582
|
+
if (a) {
|
|
583
|
+
let t = [], i = r + 1;
|
|
584
|
+
for (; i < e.length;) {
|
|
585
|
+
let n = Z.exec(e[i]);
|
|
586
|
+
if (n && n[1][0] === a[1][0] && n[1].length >= a[1].length && !n[2]) break;
|
|
587
|
+
t.push(e[i]), i += 1;
|
|
588
|
+
}
|
|
589
|
+
n.push({
|
|
590
|
+
type: "code",
|
|
591
|
+
lang: a[2] || "",
|
|
592
|
+
text: t.join("\n")
|
|
593
|
+
}), r = i + 1;
|
|
594
|
+
continue;
|
|
595
|
+
}
|
|
596
|
+
let o = xe.exec(i);
|
|
597
|
+
if (o) {
|
|
598
|
+
let e = (o[2] ?? "").replace(/[ \t]+#+[ \t]*$/, "");
|
|
599
|
+
n.push({
|
|
600
|
+
type: `h${o[1].length}`,
|
|
601
|
+
parts: Y(e, t)
|
|
602
|
+
}), r += 1;
|
|
603
|
+
continue;
|
|
604
|
+
}
|
|
605
|
+
if (Se.test(i)) {
|
|
606
|
+
n.push({ type: "divider" }), r += 1;
|
|
607
|
+
continue;
|
|
608
|
+
}
|
|
609
|
+
if (Ce.test(i)) {
|
|
610
|
+
let i = [];
|
|
611
|
+
for (; r < e.length;) {
|
|
612
|
+
let t = Ce.exec(e[r]);
|
|
613
|
+
if (t) i.push(t[1]);
|
|
614
|
+
else if (!X.test(e[r]) && i.length && !X.test(i[i.length - 1])) i.push(e[r]);
|
|
615
|
+
else break;
|
|
616
|
+
r += 1;
|
|
617
|
+
}
|
|
618
|
+
let a = Fe(i, t);
|
|
619
|
+
n.push(a.length === 1 && a[0].type === "p" ? {
|
|
620
|
+
type: "quote",
|
|
621
|
+
parts: a[0].parts
|
|
622
|
+
} : {
|
|
623
|
+
type: "quote",
|
|
624
|
+
blocks: a
|
|
625
|
+
});
|
|
626
|
+
continue;
|
|
627
|
+
}
|
|
628
|
+
if (Ae(i)) {
|
|
629
|
+
r = Ie(e, r, n, t);
|
|
630
|
+
continue;
|
|
631
|
+
}
|
|
632
|
+
if (i.includes("|") && r + 1 < e.length && Oe.test(e[r + 1])) {
|
|
633
|
+
let a = je(i), o = je(e[r + 1]).map(Me), s = [a.map((e) => Y(e, t))], c = r + 2;
|
|
634
|
+
for (; c < e.length && !X.test(e[c]) && e[c].includes("|");) {
|
|
635
|
+
let n = je(e[c]);
|
|
636
|
+
s.push(a.map((e, r) => Y(n[r] ?? "", t))), c += 1;
|
|
637
|
+
}
|
|
638
|
+
let l = {};
|
|
639
|
+
o.forEach((e, t) => {
|
|
640
|
+
e && s.forEach((n, r) => l[`${r}:${t}`] = { align: e });
|
|
641
|
+
}), n.push({
|
|
642
|
+
type: "table",
|
|
643
|
+
header: !0,
|
|
644
|
+
rows: s,
|
|
645
|
+
cellStyles: l
|
|
646
|
+
}), r = c;
|
|
647
|
+
continue;
|
|
648
|
+
}
|
|
649
|
+
let s = [i];
|
|
650
|
+
for (r += 1; r < e.length && !X.test(e[r]);) {
|
|
651
|
+
let i = e[r], a = Ee.exec(i);
|
|
652
|
+
if (a) {
|
|
653
|
+
n.push({
|
|
654
|
+
type: a[1][0] === "=" ? "h1" : "h2",
|
|
655
|
+
parts: Y(s.join("\n"), t)
|
|
656
|
+
}), r += 1, s.length = 0;
|
|
657
|
+
break;
|
|
658
|
+
}
|
|
659
|
+
if (Z.test(i) || xe.test(i) || Se.test(i) || Ce.test(i) || Ae(i)) break;
|
|
660
|
+
s.push(i), r += 1;
|
|
661
|
+
}
|
|
662
|
+
s.length && n.push(...Ne(Y(s.join("\n"), t)));
|
|
663
|
+
}
|
|
664
|
+
return n;
|
|
665
|
+
}
|
|
666
|
+
function Ie(e, t, n, r) {
|
|
667
|
+
let i = Ae(e[t]), a = i.indent, o = [], s = null, c = t;
|
|
668
|
+
for (; c < e.length;) {
|
|
669
|
+
let t = e[c], n = Ae(t);
|
|
670
|
+
if (n && n.indent <= a + 1) {
|
|
671
|
+
if (n.ordered !== i.ordered) break;
|
|
672
|
+
s = { lines: [n.text] }, o.push(s), c += 1;
|
|
673
|
+
continue;
|
|
674
|
+
}
|
|
675
|
+
if (X.test(t)) {
|
|
676
|
+
let t = c;
|
|
677
|
+
for (; t < e.length && X.test(e[t]);) t += 1;
|
|
678
|
+
if (!(t < e.length && (ke(e[t]) >= a + 2 || Ae(e[t]) && Ae(e[t]).ordered === i.ordered))) break;
|
|
679
|
+
s?.lines.push(""), c = t;
|
|
680
|
+
continue;
|
|
681
|
+
}
|
|
682
|
+
if (!s) break;
|
|
683
|
+
if (ke(t) >= a + 2) s.lines.push(t.slice(Math.min(t.length - t.trimStart().length, a + 2)));
|
|
684
|
+
else if (!n) s.lines.push(t.trim());
|
|
685
|
+
else break;
|
|
686
|
+
c += 1;
|
|
687
|
+
}
|
|
688
|
+
return n.push({
|
|
689
|
+
type: i.ordered ? "ol" : "ul",
|
|
690
|
+
...i.ordered && i.start !== 1 ? { start: i.start } : null,
|
|
691
|
+
items: o.map((e) => {
|
|
692
|
+
let t = De.exec(e.lines[0] ?? "");
|
|
693
|
+
t && (e.lines[0] = t[2]);
|
|
694
|
+
let n = Fe(e.lines, r), i = n[0]?.type === "p" ? n.shift() : null;
|
|
695
|
+
return {
|
|
696
|
+
parts: i ? i.parts : [],
|
|
697
|
+
...n.length ? { blocks: n } : null,
|
|
698
|
+
...t ? { task: t[1].toLowerCase() === "x" } : null
|
|
699
|
+
};
|
|
700
|
+
})
|
|
701
|
+
}), c;
|
|
702
|
+
}
|
|
703
|
+
function Le(e, t = {}) {
|
|
704
|
+
return String(e ?? "").trim() ? Fe(Pe(e), t) : [];
|
|
705
|
+
}
|
|
706
|
+
//#endregion
|
|
707
|
+
//#region ../ui/src/components/builder/theme.js
|
|
708
|
+
var Re = {
|
|
442
709
|
light: {
|
|
443
710
|
background: "#f2f2f2",
|
|
444
711
|
surface: "#f2f2f2",
|
|
@@ -479,32 +746,32 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
479
746
|
contrastText: "#052e2b"
|
|
480
747
|
}
|
|
481
748
|
}
|
|
482
|
-
},
|
|
749
|
+
}, ze = {
|
|
483
750
|
h1: 40,
|
|
484
751
|
h2: 32,
|
|
485
752
|
h3: 26,
|
|
486
753
|
h4: 22,
|
|
487
754
|
h5: 19,
|
|
488
755
|
h6: 16
|
|
489
|
-
},
|
|
756
|
+
}, Be = {
|
|
490
757
|
font: "system",
|
|
491
758
|
headingFont: "inherit",
|
|
492
|
-
headings:
|
|
759
|
+
headings: ze,
|
|
493
760
|
bodySize: 16,
|
|
494
|
-
light:
|
|
495
|
-
dark:
|
|
496
|
-
},
|
|
761
|
+
light: Re.light,
|
|
762
|
+
dark: Re.dark
|
|
763
|
+
}, Ve = {
|
|
497
764
|
system: {
|
|
498
765
|
label: "System",
|
|
499
|
-
value:
|
|
766
|
+
value: J
|
|
500
767
|
},
|
|
501
768
|
inter: {
|
|
502
769
|
label: "Inter",
|
|
503
|
-
value: `"Inter", ${
|
|
770
|
+
value: `"Inter", ${J}`
|
|
504
771
|
},
|
|
505
772
|
outfit: {
|
|
506
773
|
label: "Outfit",
|
|
507
|
-
value: `"Outfit", ${
|
|
774
|
+
value: `"Outfit", ${J}`
|
|
508
775
|
},
|
|
509
776
|
serif: {
|
|
510
777
|
label: "Serif",
|
|
@@ -514,7 +781,7 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
514
781
|
label: "Mono",
|
|
515
782
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
516
783
|
}
|
|
517
|
-
},
|
|
784
|
+
}, He = (e, t) => Ve[e]?.value ?? k(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), Ue = (e, ...t) => {
|
|
518
785
|
let n = Object.assign({}, e, ...t);
|
|
519
786
|
return n.primary = {
|
|
520
787
|
...e.primary,
|
|
@@ -530,25 +797,25 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
530
797
|
}), {})
|
|
531
798
|
}, n;
|
|
532
799
|
};
|
|
533
|
-
function
|
|
800
|
+
function We(e) {
|
|
534
801
|
let { light: t, dark: n, font: r, headingFont: i, headings: a, bodySize: o, ...s } = e ?? {};
|
|
535
802
|
return {
|
|
536
|
-
font: r ??
|
|
537
|
-
headingFont: i ??
|
|
803
|
+
font: r ?? Be.font,
|
|
804
|
+
headingFont: i ?? Be.headingFont,
|
|
538
805
|
headings: {
|
|
539
|
-
...
|
|
806
|
+
...ze,
|
|
540
807
|
...a ?? {}
|
|
541
808
|
},
|
|
542
809
|
bodySize: o ?? 16,
|
|
543
|
-
light:
|
|
544
|
-
dark:
|
|
810
|
+
light: Ue(Re.light, s, t),
|
|
811
|
+
dark: Ue(Re.dark, n)
|
|
545
812
|
};
|
|
546
813
|
}
|
|
547
|
-
function
|
|
814
|
+
function Ge(e) {
|
|
548
815
|
return {
|
|
549
816
|
"--page-bg": e.background,
|
|
550
817
|
"--page-surface": e.surface ?? e.background,
|
|
551
|
-
"--page-border": e.border ??
|
|
818
|
+
"--page-border": e.border ?? Re.light.border,
|
|
552
819
|
"--page-text": e.text,
|
|
553
820
|
"--page-accent": e.accent,
|
|
554
821
|
"--page-accent-text": e.accentText,
|
|
@@ -562,71 +829,71 @@ function me(e) {
|
|
|
562
829
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
563
830
|
};
|
|
564
831
|
}
|
|
565
|
-
function
|
|
566
|
-
let t =
|
|
832
|
+
function Ke(e) {
|
|
833
|
+
let t = We(e);
|
|
567
834
|
return {
|
|
568
835
|
backgroundColor: "var(--page-bg)",
|
|
569
836
|
color: "var(--page-text)",
|
|
570
|
-
fontFamily:
|
|
571
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
572
|
-
...
|
|
573
|
-
"--page-body-size":
|
|
837
|
+
fontFamily: He(t.font, J),
|
|
838
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : He(t.headingFont, "inherit"),
|
|
839
|
+
...Je(t.headings),
|
|
840
|
+
"--page-body-size": qe(t.bodySize, 16)
|
|
574
841
|
};
|
|
575
842
|
}
|
|
576
|
-
function
|
|
843
|
+
function qe(e, t) {
|
|
577
844
|
return e === "" || e == null ? `${t}px` : isNaN(Number(e)) ? String(e) : `${Number(e)}px`;
|
|
578
845
|
}
|
|
579
|
-
function
|
|
846
|
+
function Je(e) {
|
|
580
847
|
let t = {};
|
|
581
|
-
for (let n of Object.keys(
|
|
582
|
-
let r = e?.[n] ??
|
|
583
|
-
t[`--page-${n}`] =
|
|
848
|
+
for (let n of Object.keys(ze)) {
|
|
849
|
+
let r = e?.[n] ?? ze[n];
|
|
850
|
+
t[`--page-${n}`] = qe(r, ze[n]);
|
|
584
851
|
}
|
|
585
852
|
return t;
|
|
586
853
|
}
|
|
587
|
-
function
|
|
588
|
-
let n =
|
|
854
|
+
function Ye(e, t = "light") {
|
|
855
|
+
let n = We(e);
|
|
589
856
|
return {
|
|
590
|
-
...
|
|
591
|
-
...
|
|
857
|
+
...Ke(e),
|
|
858
|
+
...Ge(n[t] ?? n.light)
|
|
592
859
|
};
|
|
593
860
|
}
|
|
594
|
-
function
|
|
861
|
+
function Xe(e, t) {
|
|
595
862
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
596
863
|
}
|
|
597
|
-
function
|
|
864
|
+
function Ze(e, t) {
|
|
598
865
|
return e === "light" || e === "dark" ? e : t === "light" || t === "dark" ? t : "auto";
|
|
599
866
|
}
|
|
600
867
|
//#endregion
|
|
601
868
|
//#region ../ui/src/components/builder/views.jsx
|
|
602
|
-
var
|
|
869
|
+
var Q = n({
|
|
603
870
|
tenant: "",
|
|
604
871
|
apiUrl: "/api",
|
|
605
872
|
locale: "",
|
|
606
873
|
settings: null
|
|
607
|
-
}),
|
|
874
|
+
}), Qe = n(null), $e = (e) => {
|
|
608
875
|
let t = Number(e?.__page);
|
|
609
876
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
610
877
|
if (typeof window > "u") return 1;
|
|
611
878
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
612
879
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
613
|
-
},
|
|
880
|
+
}, et = () => {
|
|
614
881
|
if (typeof window > "u") return {};
|
|
615
882
|
let e = {};
|
|
616
883
|
return new URLSearchParams(window.location.search).forEach((t, n) => {
|
|
617
884
|
n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
|
|
618
885
|
}), e;
|
|
619
|
-
},
|
|
886
|
+
}, tt = (e) => {
|
|
620
887
|
let t = {
|
|
621
888
|
...e && typeof e == "object" && !Array.isArray(e) ? e : {},
|
|
622
|
-
...
|
|
889
|
+
...et()
|
|
623
890
|
};
|
|
624
891
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
625
|
-
},
|
|
626
|
-
function
|
|
892
|
+
}, nt = n(null), rt = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
893
|
+
function it(e, t) {
|
|
627
894
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
628
895
|
}
|
|
629
|
-
var
|
|
896
|
+
var at = (e) => {
|
|
630
897
|
let t = [];
|
|
631
898
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
632
899
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -636,39 +903,39 @@ var Te = (e) => {
|
|
|
636
903
|
}
|
|
637
904
|
return t;
|
|
638
905
|
};
|
|
639
|
-
function
|
|
906
|
+
function ot(e) {
|
|
640
907
|
return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : typeof e == "object" && !Array.isArray(e) && Number.isFinite(Number(e.lat)) && Number.isFinite(Number(e.lng)) ? `${e.lat}, ${e.lng}` : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
|
|
641
908
|
}
|
|
642
|
-
function
|
|
643
|
-
let n = t?.data ?? {}, r =
|
|
909
|
+
function st(e, t) {
|
|
910
|
+
let n = t?.data ?? {}, r = at(n);
|
|
644
911
|
if (!r.length) return e;
|
|
645
|
-
let i = RegExp(`:(${r.map(
|
|
912
|
+
let i = RegExp(`:(${r.map(rt).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => ot(it(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
646
913
|
return a(e);
|
|
647
914
|
}
|
|
648
|
-
var
|
|
915
|
+
var ct = {
|
|
649
916
|
margin: 0,
|
|
650
917
|
fontWeight: 700,
|
|
651
918
|
lineHeight: 1.2,
|
|
652
919
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
653
|
-
},
|
|
920
|
+
}, lt = ze, ut = (e) => `var(--page-${e}, ${ze[e] ?? ze.h2}px)`, dt = {
|
|
654
921
|
margin: 0,
|
|
655
922
|
fontSize: "var(--page-body-size, 16px)"
|
|
656
|
-
},
|
|
923
|
+
}, ft = {
|
|
657
924
|
display: "inline-block",
|
|
658
925
|
textDecoration: "none",
|
|
659
926
|
cursor: "pointer",
|
|
660
927
|
backgroundColor: "var(--page-accent, #111827)",
|
|
661
928
|
color: "var(--page-accent-text, #ffffff)"
|
|
662
|
-
},
|
|
929
|
+
}, pt = {
|
|
663
930
|
flexGrow: 1,
|
|
664
931
|
display: "flex",
|
|
665
932
|
flexDirection: "column",
|
|
666
933
|
position: "relative"
|
|
667
|
-
},
|
|
934
|
+
}, mt = {
|
|
668
935
|
display: "flex",
|
|
669
936
|
flexDirection: "column"
|
|
670
937
|
};
|
|
671
|
-
function
|
|
938
|
+
function ht({ style: e }) {
|
|
672
939
|
let t = e?.backgroundVideo;
|
|
673
940
|
if (!t) return null;
|
|
674
941
|
let n = {
|
|
@@ -694,7 +961,7 @@ function Fe({ style: e }) {
|
|
|
694
961
|
background: r
|
|
695
962
|
} })] });
|
|
696
963
|
}
|
|
697
|
-
var
|
|
964
|
+
var gt = (e, t) => e?.backgroundVideo ? {
|
|
698
965
|
position: "relative",
|
|
699
966
|
...t,
|
|
700
967
|
...P(e)
|
|
@@ -702,24 +969,24 @@ var Ie = (e, t) => e?.backgroundVideo ? {
|
|
|
702
969
|
...t,
|
|
703
970
|
...P(e)
|
|
704
971
|
};
|
|
705
|
-
function
|
|
972
|
+
function _t({ style: e, nodeRef: t, children: n }) {
|
|
706
973
|
return /* @__PURE__ */ f("div", {
|
|
707
974
|
ref: t,
|
|
708
975
|
style: {
|
|
709
|
-
...
|
|
976
|
+
...pt,
|
|
710
977
|
...P(e)
|
|
711
978
|
},
|
|
712
|
-
children: [/* @__PURE__ */ d(
|
|
979
|
+
children: [/* @__PURE__ */ d(ht, { style: e }), n]
|
|
713
980
|
});
|
|
714
981
|
}
|
|
715
|
-
function
|
|
982
|
+
function vt({ style: e, nodeRef: t, children: n }) {
|
|
716
983
|
return /* @__PURE__ */ f("section", {
|
|
717
984
|
ref: t,
|
|
718
|
-
style:
|
|
719
|
-
children: [/* @__PURE__ */ d(
|
|
985
|
+
style: gt(e, mt),
|
|
986
|
+
children: [/* @__PURE__ */ d(ht, { style: e }), n]
|
|
720
987
|
});
|
|
721
988
|
}
|
|
722
|
-
function
|
|
989
|
+
function yt({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
723
990
|
let i = t ? {
|
|
724
991
|
position: "relative",
|
|
725
992
|
minHeight: 240
|
|
@@ -728,33 +995,43 @@ function ze({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
728
995
|
ref: n,
|
|
729
996
|
style: i ? {
|
|
730
997
|
...i,
|
|
731
|
-
...
|
|
732
|
-
} :
|
|
733
|
-
children: [/* @__PURE__ */ d(
|
|
998
|
+
...gt(e)
|
|
999
|
+
} : gt(e),
|
|
1000
|
+
children: [/* @__PURE__ */ d(ht, { style: e }), r]
|
|
734
1001
|
});
|
|
735
1002
|
}
|
|
736
|
-
function
|
|
1003
|
+
function bt({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
737
1004
|
return /* @__PURE__ */ d(n, {
|
|
738
1005
|
ref: a,
|
|
739
1006
|
style: {
|
|
740
|
-
...
|
|
741
|
-
fontSize:
|
|
1007
|
+
...ct,
|
|
1008
|
+
fontSize: ut(n),
|
|
742
1009
|
...P(r)
|
|
743
1010
|
},
|
|
744
|
-
children:
|
|
1011
|
+
children: wt(t, e, i)
|
|
745
1012
|
});
|
|
746
1013
|
}
|
|
747
|
-
var
|
|
748
|
-
fontFamily:
|
|
1014
|
+
var xt = {
|
|
1015
|
+
fontFamily: Ve.mono.value,
|
|
749
1016
|
background: "rgba(148, 163, 184, 0.18)",
|
|
750
1017
|
padding: "1px 5px",
|
|
751
1018
|
borderRadius: 4,
|
|
752
1019
|
fontSize: "0.9em"
|
|
1020
|
+
}, St = {
|
|
1021
|
+
fontFamily: Ve.mono.value,
|
|
1022
|
+
background: "rgba(148, 163, 184, 0.16)",
|
|
1023
|
+
border: "1px solid rgba(148, 163, 184, 0.3)",
|
|
1024
|
+
borderRadius: 6,
|
|
1025
|
+
padding: "12px 14px",
|
|
1026
|
+
fontSize: "0.875em",
|
|
1027
|
+
lineHeight: 1.55,
|
|
1028
|
+
overflowX: "auto",
|
|
1029
|
+
whiteSpace: "pre"
|
|
753
1030
|
};
|
|
754
|
-
function
|
|
1031
|
+
function Ct(e, t = [], n, r) {
|
|
755
1032
|
let i = e;
|
|
756
1033
|
return t.includes("sup") ? i = /* @__PURE__ */ d("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ d("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ d("code", {
|
|
757
|
-
style:
|
|
1034
|
+
style: xt,
|
|
758
1035
|
children: i
|
|
759
1036
|
})), t.includes("strike") && (i = /* @__PURE__ */ d("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ d("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ d("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ d("strong", { children: i })), n ? i = /* @__PURE__ */ d("a", {
|
|
760
1037
|
href: n,
|
|
@@ -770,13 +1047,22 @@ function He(e, t = [], n, r) {
|
|
|
770
1047
|
children: i
|
|
771
1048
|
})), i;
|
|
772
1049
|
}
|
|
773
|
-
function
|
|
1050
|
+
function wt(e, n, r) {
|
|
774
1051
|
return e?.length ? e.map((e, n) => {
|
|
775
1052
|
if (e.slot) return /* @__PURE__ */ d(t, { children: r?.[e.slot] ?? null }, n);
|
|
776
|
-
if (e.parts) return /* @__PURE__ */ d(t, { children:
|
|
1053
|
+
if (e.parts) return /* @__PURE__ */ d(t, { children: wt(e.parts, "", r) }, n);
|
|
1054
|
+
if (e.br) return /* @__PURE__ */ d("br", {}, n);
|
|
777
1055
|
let i = e.text;
|
|
778
|
-
return e.
|
|
779
|
-
|
|
1056
|
+
return e.image && (i = /* @__PURE__ */ d("img", {
|
|
1057
|
+
src: e.image.src,
|
|
1058
|
+
alt: e.image.alt || "",
|
|
1059
|
+
title: e.image.title || void 0,
|
|
1060
|
+
style: {
|
|
1061
|
+
maxWidth: "100%",
|
|
1062
|
+
verticalAlign: "middle"
|
|
1063
|
+
}
|
|
1064
|
+
})), e.sup ? i = /* @__PURE__ */ d("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ d("sub", { children: i })), e.code && (i = /* @__PURE__ */ d("code", {
|
|
1065
|
+
style: xt,
|
|
780
1066
|
children: i
|
|
781
1067
|
})), e.strike && (i = /* @__PURE__ */ d("s", { children: i })), e.underline && (i = /* @__PURE__ */ d("u", { children: i })), e.italic && (i = /* @__PURE__ */ d("em", { children: i })), e.bold && (i = /* @__PURE__ */ d("strong", { children: i })), (e.color || e.background) && (i = /* @__PURE__ */ d("span", {
|
|
782
1068
|
style: {
|
|
@@ -799,35 +1085,35 @@ function Ue(e, n, r) {
|
|
|
799
1085
|
})), /* @__PURE__ */ d(t, { children: i }, n);
|
|
800
1086
|
}) : n;
|
|
801
1087
|
}
|
|
802
|
-
function
|
|
1088
|
+
function Tt({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
803
1089
|
return /* @__PURE__ */ d("span", {
|
|
804
1090
|
style: P(a),
|
|
805
|
-
children: e?.length ?
|
|
1091
|
+
children: e?.length ? wt(e, t) : Ct(t, n, r, i)
|
|
806
1092
|
});
|
|
807
1093
|
}
|
|
808
|
-
var
|
|
1094
|
+
var Et = [
|
|
809
1095
|
"left",
|
|
810
1096
|
"center",
|
|
811
1097
|
"right",
|
|
812
1098
|
"justify"
|
|
813
1099
|
];
|
|
814
|
-
function
|
|
1100
|
+
function Dt(e, t, n) {
|
|
815
1101
|
let r = e && e.cellStyles;
|
|
816
1102
|
if (!r || typeof r != "object" || Array.isArray(r)) return {};
|
|
817
1103
|
let i = r[`${t}:${n}`];
|
|
818
1104
|
return i && typeof i == "object" && !Array.isArray(i) ? i : {};
|
|
819
1105
|
}
|
|
820
|
-
function
|
|
1106
|
+
function Ot(e, t) {
|
|
821
1107
|
let n = e || {}, r = typeof n.bold == "boolean" ? n.bold : !!t;
|
|
822
1108
|
return {
|
|
823
|
-
textAlign:
|
|
1109
|
+
textAlign: Et.includes(n.align) ? n.align : "left",
|
|
824
1110
|
fontWeight: r ? 700 : 400,
|
|
825
1111
|
fontStyle: n.italic ? "italic" : void 0,
|
|
826
1112
|
color: typeof n.color == "string" && n.color ? n.color : void 0,
|
|
827
1113
|
backgroundColor: typeof n.bg == "string" && n.bg ? n.bg : void 0
|
|
828
1114
|
};
|
|
829
1115
|
}
|
|
830
|
-
function
|
|
1116
|
+
function kt({ align: e = "center", width: t, wrap: n } = {}) {
|
|
831
1117
|
let r = t ? `${t}%` : void 0;
|
|
832
1118
|
if (e === "full") return { width: "100%" };
|
|
833
1119
|
let i = e === "left" || e === "right";
|
|
@@ -861,18 +1147,18 @@ function Je({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
861
1147
|
marginRight: "auto"
|
|
862
1148
|
};
|
|
863
1149
|
}
|
|
864
|
-
function
|
|
865
|
-
let r = n ?? ((e, n) =>
|
|
866
|
-
return e.map((
|
|
867
|
-
let
|
|
1150
|
+
function At(e = [], t, n) {
|
|
1151
|
+
let r = n ?? ((e, n) => wt(e, n, t));
|
|
1152
|
+
return e.map((n, i) => {
|
|
1153
|
+
let a = {
|
|
868
1154
|
marginTop: 0,
|
|
869
|
-
marginBottom:
|
|
1155
|
+
marginBottom: i === e.length - 1 ? 0 : 14
|
|
870
1156
|
};
|
|
871
|
-
if (
|
|
872
|
-
if (!
|
|
1157
|
+
if (n.type === "image") {
|
|
1158
|
+
if (!n.src) return null;
|
|
873
1159
|
let e = /* @__PURE__ */ d("img", {
|
|
874
|
-
src:
|
|
875
|
-
alt:
|
|
1160
|
+
src: n.src,
|
|
1161
|
+
alt: n.alt || "",
|
|
876
1162
|
style: {
|
|
877
1163
|
width: "100%",
|
|
878
1164
|
display: "block",
|
|
@@ -883,51 +1169,51 @@ function Ye(e = [], t, n) {
|
|
|
883
1169
|
style: {
|
|
884
1170
|
marginLeft: 0,
|
|
885
1171
|
marginRight: 0,
|
|
886
|
-
...
|
|
887
|
-
...
|
|
1172
|
+
...a,
|
|
1173
|
+
...kt(n)
|
|
888
1174
|
},
|
|
889
|
-
children: [
|
|
890
|
-
href:
|
|
891
|
-
target:
|
|
892
|
-
rel:
|
|
1175
|
+
children: [n.href ? /* @__PURE__ */ d("a", {
|
|
1176
|
+
href: n.href,
|
|
1177
|
+
target: n.target || void 0,
|
|
1178
|
+
rel: n.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
893
1179
|
style: { display: "block" },
|
|
894
1180
|
children: e
|
|
895
|
-
}) : e,
|
|
1181
|
+
}) : e, n.caption && /* @__PURE__ */ d("figcaption", {
|
|
896
1182
|
style: {
|
|
897
1183
|
fontSize: 13,
|
|
898
1184
|
opacity: .65,
|
|
899
1185
|
marginTop: 6,
|
|
900
1186
|
textAlign: "center"
|
|
901
1187
|
},
|
|
902
|
-
children:
|
|
1188
|
+
children: n.caption
|
|
903
1189
|
})]
|
|
904
|
-
},
|
|
1190
|
+
}, i);
|
|
905
1191
|
}
|
|
906
|
-
if (
|
|
1192
|
+
if (n.type === "video") return Ht(n.url) ? /* @__PURE__ */ d("div", {
|
|
907
1193
|
style: {
|
|
908
|
-
...
|
|
909
|
-
...
|
|
910
|
-
align:
|
|
911
|
-
wrap:
|
|
912
|
-
width:
|
|
1194
|
+
...a,
|
|
1195
|
+
...kt({
|
|
1196
|
+
align: n.align,
|
|
1197
|
+
wrap: n.wrap,
|
|
1198
|
+
width: n.width ?? 100
|
|
913
1199
|
})
|
|
914
1200
|
},
|
|
915
|
-
children: /* @__PURE__ */ d(
|
|
916
|
-
url:
|
|
917
|
-
autoplay:
|
|
918
|
-
muted:
|
|
919
|
-
loop:
|
|
920
|
-
controls:
|
|
921
|
-
start:
|
|
1201
|
+
children: /* @__PURE__ */ d(Ut, {
|
|
1202
|
+
url: n.url,
|
|
1203
|
+
autoplay: n.autoplay,
|
|
1204
|
+
muted: n.muted,
|
|
1205
|
+
loop: n.loop,
|
|
1206
|
+
controls: n.controls ?? !0,
|
|
1207
|
+
start: n.start
|
|
922
1208
|
})
|
|
923
|
-
},
|
|
924
|
-
if (
|
|
925
|
-
if (!(typeof
|
|
926
|
-
let e = Number.isFinite(Number(
|
|
1209
|
+
}, i) : null;
|
|
1210
|
+
if (n.type === "button") {
|
|
1211
|
+
if (!(typeof n.label == "string" && n.label.trim())) return null;
|
|
1212
|
+
let e = Number.isFinite(Number(n.radius)) ? Number(n.radius) : 8, t = ["center", "right"].includes(n.align) ? n.align : "left";
|
|
927
1213
|
return /* @__PURE__ */ d("div", {
|
|
928
1214
|
style: {
|
|
929
|
-
...
|
|
930
|
-
textAlign:
|
|
1215
|
+
...a,
|
|
1216
|
+
textAlign: t
|
|
931
1217
|
},
|
|
932
1218
|
children: /* @__PURE__ */ d("table", {
|
|
933
1219
|
role: "presentation",
|
|
@@ -939,132 +1225,171 @@ function Ye(e = [], t, n) {
|
|
|
939
1225
|
},
|
|
940
1226
|
children: /* @__PURE__ */ d("tbody", { children: /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
|
|
941
1227
|
style: {
|
|
942
|
-
backgroundColor:
|
|
1228
|
+
backgroundColor: n.bg || "var(--page-accent, #4f46e5)",
|
|
943
1229
|
borderRadius: e
|
|
944
1230
|
},
|
|
945
1231
|
children: /* @__PURE__ */ d("a", {
|
|
946
|
-
href:
|
|
947
|
-
target:
|
|
948
|
-
rel:
|
|
1232
|
+
href: n.href || "#",
|
|
1233
|
+
target: n.target || void 0,
|
|
1234
|
+
rel: n.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
949
1235
|
style: {
|
|
950
1236
|
display: "inline-block",
|
|
951
1237
|
padding: "13px 24px",
|
|
952
|
-
color:
|
|
1238
|
+
color: n.color || "#ffffff",
|
|
953
1239
|
fontSize: 15,
|
|
954
1240
|
fontWeight: 600,
|
|
955
1241
|
lineHeight: 1.2,
|
|
956
1242
|
textDecoration: "none",
|
|
957
1243
|
borderRadius: e
|
|
958
1244
|
},
|
|
959
|
-
children:
|
|
1245
|
+
children: n.label
|
|
960
1246
|
})
|
|
961
1247
|
}) }) })
|
|
962
1248
|
})
|
|
963
|
-
},
|
|
1249
|
+
}, i);
|
|
964
1250
|
}
|
|
965
|
-
if (
|
|
966
|
-
...
|
|
1251
|
+
if (n.type === "divider") return /* @__PURE__ */ d("hr", { style: {
|
|
1252
|
+
...a,
|
|
967
1253
|
border: 0,
|
|
968
1254
|
borderTop: "1px solid rgba(148, 163, 184, 0.4)"
|
|
969
|
-
} },
|
|
970
|
-
if (
|
|
971
|
-
let e = Array.isArray(
|
|
1255
|
+
} }, i);
|
|
1256
|
+
if (n.type === "table") {
|
|
1257
|
+
let e = Array.isArray(n.rows) ? n.rows.filter(Array.isArray) : [];
|
|
972
1258
|
if (!e.length) return null;
|
|
973
|
-
let
|
|
974
|
-
border:
|
|
1259
|
+
let t = n.header !== !1, o = {
|
|
1260
|
+
border: n.borders === !1 ? void 0 : "1px solid rgba(148, 163, 184, 0.4)",
|
|
975
1261
|
padding: "6px 10px",
|
|
976
1262
|
verticalAlign: "top"
|
|
977
|
-
},
|
|
978
|
-
...
|
|
979
|
-
...
|
|
1263
|
+
}, s = t ? e.slice(1) : e, c = Array.isArray(n.widths) ? n.widths : null, l = (e, t, r) => ({
|
|
1264
|
+
...o,
|
|
1265
|
+
...Ot(Dt(n, e, t), r)
|
|
980
1266
|
});
|
|
981
1267
|
return /* @__PURE__ */ f("table", {
|
|
982
1268
|
style: {
|
|
983
|
-
...
|
|
1269
|
+
...a,
|
|
984
1270
|
borderCollapse: "collapse",
|
|
985
1271
|
width: "100%",
|
|
986
1272
|
fontSize: "inherit",
|
|
987
|
-
tableLayout:
|
|
1273
|
+
tableLayout: c ? "fixed" : void 0
|
|
988
1274
|
},
|
|
989
1275
|
children: [
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
style:
|
|
993
|
-
children: e
|
|
1276
|
+
c && /* @__PURE__ */ d("colgroup", { children: c.map((e, t) => /* @__PURE__ */ d("col", { style: { width: `${e}%` } }, t)) }),
|
|
1277
|
+
t && /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e[0].map((e, t) => /* @__PURE__ */ d("th", {
|
|
1278
|
+
style: l(0, t, !0),
|
|
1279
|
+
children: Array.isArray(e) ? r(e) : e
|
|
994
1280
|
}, t)) }) }),
|
|
995
|
-
/* @__PURE__ */ d("tbody", { children:
|
|
996
|
-
style:
|
|
997
|
-
children: e
|
|
998
|
-
},
|
|
1281
|
+
/* @__PURE__ */ d("tbody", { children: s.map((e, n) => /* @__PURE__ */ d("tr", { children: e.map((e, i) => /* @__PURE__ */ d("td", {
|
|
1282
|
+
style: l(t ? n + 1 : n, i, !1),
|
|
1283
|
+
children: Array.isArray(e) ? r(e) : e
|
|
1284
|
+
}, i)) }, n)) })
|
|
999
1285
|
]
|
|
1000
|
-
},
|
|
1286
|
+
}, i);
|
|
1001
1287
|
}
|
|
1002
|
-
if (
|
|
1003
|
-
let e =
|
|
1288
|
+
if (n.type === "ul" || n.type === "ol") {
|
|
1289
|
+
let e = n.type;
|
|
1004
1290
|
return /* @__PURE__ */ d(e, {
|
|
1005
1291
|
style: {
|
|
1006
|
-
...
|
|
1292
|
+
...a,
|
|
1007
1293
|
paddingLeft: 24
|
|
1008
1294
|
},
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1295
|
+
start: n.type === "ol" ? n.start : void 0,
|
|
1296
|
+
children: (n.items ?? []).map((e, n) => {
|
|
1297
|
+
let i = typeof e.task == "boolean";
|
|
1298
|
+
return /* @__PURE__ */ f("li", {
|
|
1299
|
+
style: {
|
|
1300
|
+
marginBottom: 4,
|
|
1301
|
+
...i && {
|
|
1302
|
+
listStyleType: "none",
|
|
1303
|
+
marginLeft: -18
|
|
1304
|
+
}
|
|
1305
|
+
},
|
|
1306
|
+
children: [
|
|
1307
|
+
i && /* @__PURE__ */ d("span", {
|
|
1308
|
+
style: { marginRight: 6 },
|
|
1309
|
+
children: e.task ? "☑" : "☐"
|
|
1310
|
+
}),
|
|
1311
|
+
r(e.parts, e.text),
|
|
1312
|
+
e.blocks?.length ? At(e.blocks, t, r) : null
|
|
1313
|
+
]
|
|
1314
|
+
}, n);
|
|
1315
|
+
})
|
|
1316
|
+
}, i);
|
|
1014
1317
|
}
|
|
1015
|
-
if (
|
|
1318
|
+
if (n.type === "quote") return /* @__PURE__ */ d("blockquote", {
|
|
1016
1319
|
style: {
|
|
1017
|
-
...
|
|
1018
|
-
...
|
|
1320
|
+
...Nt,
|
|
1321
|
+
...a
|
|
1019
1322
|
},
|
|
1020
|
-
children: r(
|
|
1021
|
-
},
|
|
1022
|
-
if (
|
|
1023
|
-
|
|
1323
|
+
children: n.blocks?.length ? At(n.blocks, t, r) : r(n.parts, n.text)
|
|
1324
|
+
}, i);
|
|
1325
|
+
if (n.type === "code") return /* @__PURE__ */ d("pre", {
|
|
1326
|
+
"data-lang": n.lang || void 0,
|
|
1327
|
+
style: {
|
|
1328
|
+
...a,
|
|
1329
|
+
...St
|
|
1330
|
+
},
|
|
1331
|
+
children: /* @__PURE__ */ d("code", {
|
|
1332
|
+
style: { fontFamily: "inherit" },
|
|
1333
|
+
children: n.text
|
|
1334
|
+
})
|
|
1335
|
+
}, i);
|
|
1336
|
+
if (lt[n.type]) {
|
|
1337
|
+
let e = n.type;
|
|
1024
1338
|
return /* @__PURE__ */ d(e, {
|
|
1025
1339
|
style: {
|
|
1026
|
-
...
|
|
1027
|
-
fontSize:
|
|
1028
|
-
...
|
|
1340
|
+
...ct,
|
|
1341
|
+
fontSize: ut(n.type),
|
|
1342
|
+
...a
|
|
1029
1343
|
},
|
|
1030
|
-
children: r(
|
|
1031
|
-
},
|
|
1344
|
+
children: r(n.parts, n.text)
|
|
1345
|
+
}, i);
|
|
1032
1346
|
}
|
|
1033
1347
|
return /* @__PURE__ */ d("p", {
|
|
1034
1348
|
style: {
|
|
1035
|
-
...
|
|
1036
|
-
...
|
|
1349
|
+
...dt,
|
|
1350
|
+
...a
|
|
1037
1351
|
},
|
|
1038
|
-
children: r(
|
|
1039
|
-
},
|
|
1352
|
+
children: r(n.parts, n.text)
|
|
1353
|
+
}, i);
|
|
1040
1354
|
});
|
|
1041
1355
|
}
|
|
1042
|
-
function
|
|
1356
|
+
function jt({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
1043
1357
|
return /* @__PURE__ */ d("div", {
|
|
1044
1358
|
ref: r,
|
|
1045
1359
|
style: {
|
|
1046
1360
|
display: "flow-root",
|
|
1047
1361
|
...P(t)
|
|
1048
1362
|
},
|
|
1049
|
-
children:
|
|
1363
|
+
children: At(e, n)
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
function Mt({ markdown: e, newTab: t, style: n, nodeRef: r }) {
|
|
1367
|
+
let i = s(() => Le(e, { newTab: t }), [e, t]);
|
|
1368
|
+
return /* @__PURE__ */ d("div", {
|
|
1369
|
+
ref: r,
|
|
1370
|
+
style: {
|
|
1371
|
+
display: "flow-root",
|
|
1372
|
+
...P(n)
|
|
1373
|
+
},
|
|
1374
|
+
children: At(i)
|
|
1050
1375
|
});
|
|
1051
1376
|
}
|
|
1052
|
-
var
|
|
1377
|
+
var Nt = {
|
|
1053
1378
|
margin: 0,
|
|
1054
1379
|
padding: "8px 0 8px 20px",
|
|
1055
1380
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
1056
1381
|
};
|
|
1057
|
-
function
|
|
1382
|
+
function Pt({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
1058
1383
|
return /* @__PURE__ */ d("blockquote", {
|
|
1059
1384
|
ref: i,
|
|
1060
1385
|
style: {
|
|
1061
|
-
...
|
|
1386
|
+
...Nt,
|
|
1062
1387
|
...P(n)
|
|
1063
1388
|
},
|
|
1064
|
-
children:
|
|
1389
|
+
children: wt(t, e, r)
|
|
1065
1390
|
});
|
|
1066
1391
|
}
|
|
1067
|
-
function
|
|
1392
|
+
function Ft({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
1068
1393
|
return /* @__PURE__ */ d(e ? "ol" : "ul", {
|
|
1069
1394
|
ref: r,
|
|
1070
1395
|
style: {
|
|
@@ -1074,53 +1399,53 @@ function $e({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
|
1074
1399
|
},
|
|
1075
1400
|
children: t.map((e, t) => /* @__PURE__ */ d("li", {
|
|
1076
1401
|
style: { marginBottom: 4 },
|
|
1077
|
-
children:
|
|
1402
|
+
children: wt(e.parts, e.text)
|
|
1078
1403
|
}, t))
|
|
1079
1404
|
});
|
|
1080
1405
|
}
|
|
1081
|
-
function
|
|
1406
|
+
function It({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
1082
1407
|
return /* @__PURE__ */ d("p", {
|
|
1083
1408
|
ref: i,
|
|
1084
1409
|
style: {
|
|
1085
|
-
...
|
|
1410
|
+
...dt,
|
|
1086
1411
|
...P(n)
|
|
1087
1412
|
},
|
|
1088
|
-
children:
|
|
1413
|
+
children: wt(t, e, r)
|
|
1089
1414
|
});
|
|
1090
1415
|
}
|
|
1091
|
-
var
|
|
1416
|
+
var Lt = {
|
|
1092
1417
|
color: "var(--page-accent, inherit)",
|
|
1093
1418
|
textDecoration: "underline",
|
|
1094
1419
|
textUnderlineOffset: 3,
|
|
1095
1420
|
cursor: "pointer"
|
|
1096
1421
|
};
|
|
1097
|
-
function
|
|
1422
|
+
function Rt({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
1098
1423
|
return /* @__PURE__ */ d("a", {
|
|
1099
1424
|
ref: o,
|
|
1100
1425
|
href: n || "#",
|
|
1101
1426
|
target: r || void 0,
|
|
1102
1427
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1103
1428
|
style: {
|
|
1104
|
-
...
|
|
1429
|
+
...Lt,
|
|
1105
1430
|
...P(i)
|
|
1106
1431
|
},
|
|
1107
|
-
children:
|
|
1432
|
+
children: wt(t, e, a)
|
|
1108
1433
|
});
|
|
1109
1434
|
}
|
|
1110
|
-
function
|
|
1435
|
+
function zt({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
1111
1436
|
return /* @__PURE__ */ d("a", {
|
|
1112
1437
|
ref: o,
|
|
1113
1438
|
href: n || "#",
|
|
1114
1439
|
target: r || void 0,
|
|
1115
1440
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1116
1441
|
style: {
|
|
1117
|
-
...
|
|
1442
|
+
...ft,
|
|
1118
1443
|
...P(i)
|
|
1119
1444
|
},
|
|
1120
|
-
children:
|
|
1445
|
+
children: wt(t, e, a)
|
|
1121
1446
|
});
|
|
1122
1447
|
}
|
|
1123
|
-
function
|
|
1448
|
+
function Bt({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
1124
1449
|
return e ? /* @__PURE__ */ d("img", {
|
|
1125
1450
|
ref: r,
|
|
1126
1451
|
src: e,
|
|
@@ -1132,7 +1457,7 @@ function it({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
1132
1457
|
}
|
|
1133
1458
|
}) : null;
|
|
1134
1459
|
}
|
|
1135
|
-
function
|
|
1460
|
+
function Vt({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
1136
1461
|
return e ? /* @__PURE__ */ d("video", {
|
|
1137
1462
|
ref: s,
|
|
1138
1463
|
src: e,
|
|
@@ -1150,9 +1475,9 @@ function at({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
1150
1475
|
}
|
|
1151
1476
|
}) : null;
|
|
1152
1477
|
}
|
|
1153
|
-
var
|
|
1154
|
-
function
|
|
1155
|
-
let c =
|
|
1478
|
+
var Ht = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
1479
|
+
function Ut({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
1480
|
+
let c = Ht(e);
|
|
1156
1481
|
if (!c) return null;
|
|
1157
1482
|
let l = new URLSearchParams({ rel: "0" });
|
|
1158
1483
|
return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ d("div", {
|
|
@@ -1178,7 +1503,7 @@ function st({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
1178
1503
|
})
|
|
1179
1504
|
});
|
|
1180
1505
|
}
|
|
1181
|
-
function
|
|
1506
|
+
function Wt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
1182
1507
|
return e ? /* @__PURE__ */ d("iframe", {
|
|
1183
1508
|
ref: i,
|
|
1184
1509
|
src: e,
|
|
@@ -1194,26 +1519,33 @@ function ct({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
1194
1519
|
}
|
|
1195
1520
|
}) : null;
|
|
1196
1521
|
}
|
|
1197
|
-
|
|
1198
|
-
|
|
1522
|
+
var Gt = /(^|[\s,>+~{}])(:root|html|body)(?=$|[\s,{.:#[>+~])/g;
|
|
1523
|
+
function Kt(e) {
|
|
1524
|
+
return `@scope ([data-wb-embed]) {\n${e.replace(Gt, "$1:scope")}\n}`;
|
|
1525
|
+
}
|
|
1526
|
+
function qt({ code: e, runScripts: t = !0, scopeStyles: n = !1, style: r, nodeRef: i }) {
|
|
1527
|
+
let [o, s] = l(null);
|
|
1199
1528
|
return a(() => {
|
|
1200
|
-
|
|
1529
|
+
o && (o.innerHTML = e || "", n ? (o.setAttribute("data-wb-embed", ""), o.querySelectorAll("style").forEach((e) => {
|
|
1530
|
+
e.textContent = Kt(e.textContent || "");
|
|
1531
|
+
})) : o.removeAttribute("data-wb-embed"), t && o.querySelectorAll("script").forEach((e) => {
|
|
1201
1532
|
let t = document.createElement("script");
|
|
1202
1533
|
for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
|
|
1203
1534
|
t.text = e.textContent, e.replaceWith(t);
|
|
1204
1535
|
}));
|
|
1205
1536
|
}, [
|
|
1206
|
-
|
|
1537
|
+
o,
|
|
1207
1538
|
e,
|
|
1208
|
-
t
|
|
1539
|
+
t,
|
|
1540
|
+
n
|
|
1209
1541
|
]), /* @__PURE__ */ d("div", {
|
|
1210
1542
|
ref: (e) => {
|
|
1211
|
-
|
|
1543
|
+
s(e), i && i(e);
|
|
1212
1544
|
},
|
|
1213
|
-
style: P(
|
|
1545
|
+
style: P(r)
|
|
1214
1546
|
});
|
|
1215
1547
|
}
|
|
1216
|
-
function
|
|
1548
|
+
function Jt({ height: e, style: t, nodeRef: n }) {
|
|
1217
1549
|
return /* @__PURE__ */ d("div", {
|
|
1218
1550
|
ref: n,
|
|
1219
1551
|
style: {
|
|
@@ -1224,7 +1556,7 @@ function ut({ height: e, style: t, nodeRef: n }) {
|
|
|
1224
1556
|
}
|
|
1225
1557
|
});
|
|
1226
1558
|
}
|
|
1227
|
-
function
|
|
1559
|
+
function Yt({ style: e, nodeRef: t }) {
|
|
1228
1560
|
return /* @__PURE__ */ d("div", {
|
|
1229
1561
|
ref: t,
|
|
1230
1562
|
style: {
|
|
@@ -1235,7 +1567,7 @@ function dt({ style: e, nodeRef: t }) {
|
|
|
1235
1567
|
}
|
|
1236
1568
|
});
|
|
1237
1569
|
}
|
|
1238
|
-
function
|
|
1570
|
+
function Xt({ style: e, nodeRef: t }) {
|
|
1239
1571
|
return /* @__PURE__ */ d("div", {
|
|
1240
1572
|
ref: t,
|
|
1241
1573
|
style: {
|
|
@@ -1244,7 +1576,7 @@ function ft({ style: e, nodeRef: t }) {
|
|
|
1244
1576
|
}
|
|
1245
1577
|
});
|
|
1246
1578
|
}
|
|
1247
|
-
var
|
|
1579
|
+
var Zt = {
|
|
1248
1580
|
position: "absolute",
|
|
1249
1581
|
top: "50%",
|
|
1250
1582
|
transform: "translateY(-50%)",
|
|
@@ -1261,7 +1593,7 @@ var pt = {
|
|
|
1261
1593
|
alignItems: "center",
|
|
1262
1594
|
justifyContent: "center",
|
|
1263
1595
|
padding: 0
|
|
1264
|
-
},
|
|
1596
|
+
}, Qt = {
|
|
1265
1597
|
bottom: {
|
|
1266
1598
|
inset: "auto 0 0 0",
|
|
1267
1599
|
padding: "40px 24px 20px",
|
|
@@ -1280,8 +1612,8 @@ var pt = {
|
|
|
1280
1612
|
padding: 24,
|
|
1281
1613
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1282
1614
|
}
|
|
1283
|
-
},
|
|
1284
|
-
function
|
|
1615
|
+
}, $t = 48;
|
|
1616
|
+
function en({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
|
|
1285
1617
|
let [p, m] = l(0), [h, g] = l(!1), [_, v] = l(null), y = e ? Math.min(p, e - 1) : 0;
|
|
1286
1618
|
if (a(() => {
|
|
1287
1619
|
if (!n || h || _ || e < 2) return;
|
|
@@ -1297,7 +1629,7 @@ function gt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1297
1629
|
let b = (t) => m((t + e) % e), x = () => {
|
|
1298
1630
|
if (!_) return;
|
|
1299
1631
|
let { dx: e } = _;
|
|
1300
|
-
v(null), e < -48 ? b(y + 1) : e >
|
|
1632
|
+
v(null), e < -48 ? b(y + 1) : e > $t && b(y - 1);
|
|
1301
1633
|
};
|
|
1302
1634
|
return /* @__PURE__ */ f("div", {
|
|
1303
1635
|
ref: c,
|
|
@@ -1346,7 +1678,7 @@ function gt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1346
1678
|
type: "button",
|
|
1347
1679
|
"aria-label": "Previous slide",
|
|
1348
1680
|
style: {
|
|
1349
|
-
...
|
|
1681
|
+
...Zt,
|
|
1350
1682
|
left: 12
|
|
1351
1683
|
},
|
|
1352
1684
|
onClick: () => b(y - 1),
|
|
@@ -1356,7 +1688,7 @@ function gt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1356
1688
|
type: "button",
|
|
1357
1689
|
"aria-label": "Next slide",
|
|
1358
1690
|
style: {
|
|
1359
|
-
...
|
|
1691
|
+
...Zt,
|
|
1360
1692
|
right: 12
|
|
1361
1693
|
},
|
|
1362
1694
|
onClick: () => b(y + 1),
|
|
@@ -1390,7 +1722,7 @@ function gt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1390
1722
|
] })]
|
|
1391
1723
|
});
|
|
1392
1724
|
}
|
|
1393
|
-
var
|
|
1725
|
+
var tn = (e, t) => ({
|
|
1394
1726
|
position: "absolute",
|
|
1395
1727
|
inset: 0,
|
|
1396
1728
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1398,18 +1730,18 @@ var _t = (e, t) => ({
|
|
|
1398
1730
|
backgroundSize: "cover",
|
|
1399
1731
|
backgroundPosition: "center"
|
|
1400
1732
|
});
|
|
1401
|
-
function
|
|
1402
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1733
|
+
function nn({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1734
|
+
return e.length ? /* @__PURE__ */ d(en, {
|
|
1403
1735
|
...r,
|
|
1404
1736
|
count: e.length,
|
|
1405
1737
|
renderSlide: (r) => {
|
|
1406
1738
|
let i = e[r];
|
|
1407
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1739
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: tn(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
|
|
1408
1740
|
style: {
|
|
1409
1741
|
position: "absolute",
|
|
1410
1742
|
color: "#fff",
|
|
1411
1743
|
textAlign: n,
|
|
1412
|
-
...
|
|
1744
|
+
...Qt[t] ?? Qt.bottom
|
|
1413
1745
|
},
|
|
1414
1746
|
children: [i.title && /* @__PURE__ */ d("div", {
|
|
1415
1747
|
style: {
|
|
@@ -1429,13 +1761,13 @@ function vt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1429
1761
|
}
|
|
1430
1762
|
}) : null;
|
|
1431
1763
|
}
|
|
1432
|
-
function
|
|
1433
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1764
|
+
function rn({ slides: e = [], linked: t, ...n }) {
|
|
1765
|
+
return e.length ? /* @__PURE__ */ d(en, {
|
|
1434
1766
|
...n,
|
|
1435
1767
|
count: e.length,
|
|
1436
1768
|
renderSlide: (n) => {
|
|
1437
1769
|
let r = e[n];
|
|
1438
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1770
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: tn(r.image, r.color) }), /* @__PURE__ */ d("div", {
|
|
1439
1771
|
style: {
|
|
1440
1772
|
position: "absolute",
|
|
1441
1773
|
inset: 0,
|
|
@@ -1447,23 +1779,23 @@ function yt({ slides: e = [], linked: t, ...n }) {
|
|
|
1447
1779
|
}
|
|
1448
1780
|
}) : null;
|
|
1449
1781
|
}
|
|
1450
|
-
var
|
|
1451
|
-
let r =
|
|
1782
|
+
var an = 256, on = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), sn = (e, t, n) => {
|
|
1783
|
+
let r = an * 2 ** n;
|
|
1452
1784
|
return {
|
|
1453
1785
|
x: (Number(t) + 180) / 360 * r,
|
|
1454
|
-
y: (.5 -
|
|
1786
|
+
y: (.5 - on(Number(e)) / (2 * Math.PI)) * r
|
|
1455
1787
|
};
|
|
1456
1788
|
}, $ = (e, t) => {
|
|
1457
1789
|
if (e === "" || e == null) return null;
|
|
1458
1790
|
let n = Number(e);
|
|
1459
1791
|
return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
|
|
1460
|
-
},
|
|
1461
|
-
function
|
|
1792
|
+
}, cn = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
|
|
1793
|
+
function ln(e, t, n = "directions", r = "") {
|
|
1462
1794
|
let i = `${e},${t}`;
|
|
1463
1795
|
return n === "place" ? `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(i)}${r ? "&query_place_id=" : ""}` : `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(i)}`;
|
|
1464
1796
|
}
|
|
1465
|
-
var
|
|
1466
|
-
function
|
|
1797
|
+
var un = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
|
|
1798
|
+
function dn({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize: o = 22, pinLink: s = "directions", link: u = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
|
|
1467
1799
|
let _ = c(null), [v, y] = l(1200);
|
|
1468
1800
|
a(() => {
|
|
1469
1801
|
let e = _.current;
|
|
@@ -1473,7 +1805,7 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1473
1805
|
let n = new ResizeObserver(t);
|
|
1474
1806
|
return n.observe(e), () => n.disconnect();
|
|
1475
1807
|
}, []);
|
|
1476
|
-
let b = (Array.isArray(e) ? e : []).filter(
|
|
1808
|
+
let b = (Array.isArray(e) ? e : []).filter(cn), x = cn({
|
|
1477
1809
|
lat: t,
|
|
1478
1810
|
lng: n
|
|
1479
1811
|
}) ? {
|
|
@@ -1485,7 +1817,7 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1485
1817
|
} : null, S = Math.max(80, Number(i) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
|
|
1486
1818
|
if (b.length < 2) return 13;
|
|
1487
1819
|
for (let e = 19; e >= 1; e--) {
|
|
1488
|
-
let t = b.map((t) =>
|
|
1820
|
+
let t = b.map((t) => sn($(t.lat, 90), $(t.lng, 180), e)), n = Math.max(...t.map((e) => e.x)) - Math.min(...t.map((e) => e.x)), r = Math.max(...t.map((e) => e.y)) - Math.min(...t.map((e) => e.y));
|
|
1489
1821
|
if (n <= v * .8 && r <= S * .7) return e;
|
|
1490
1822
|
}
|
|
1491
1823
|
return 1;
|
|
@@ -1509,12 +1841,12 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1509
1841
|
},
|
|
1510
1842
|
children: "Set the coordinates in Settings"
|
|
1511
1843
|
});
|
|
1512
|
-
let T =
|
|
1844
|
+
let T = sn(x.lat, x.lng, C), E = {
|
|
1513
1845
|
x: T.x - v / 2,
|
|
1514
1846
|
y: T.y - S / 2
|
|
1515
1847
|
}, D = [], O = [];
|
|
1516
|
-
for (let e = Math.floor(E.x /
|
|
1517
|
-
for (let e = Math.floor(E.y /
|
|
1848
|
+
for (let e = Math.floor(E.x / an); e <= Math.floor((E.x + v) / an); e++) D.push(e);
|
|
1849
|
+
for (let e = Math.floor(E.y / an); e <= Math.floor((E.y + S) / an); e++) O.push(e);
|
|
1518
1850
|
let k = 2 ** C;
|
|
1519
1851
|
return /* @__PURE__ */ f("div", {
|
|
1520
1852
|
ref: (e) => {
|
|
@@ -1537,22 +1869,22 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1537
1869
|
return e < 0 || e >= k ? null : /* @__PURE__ */ d("img", {
|
|
1538
1870
|
src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
|
|
1539
1871
|
alt: "",
|
|
1540
|
-
width:
|
|
1541
|
-
height:
|
|
1872
|
+
width: an,
|
|
1873
|
+
height: an,
|
|
1542
1874
|
loading: "lazy",
|
|
1543
1875
|
style: {
|
|
1544
1876
|
position: "absolute",
|
|
1545
|
-
left: Math.round(t *
|
|
1546
|
-
top: Math.round(e *
|
|
1547
|
-
width:
|
|
1548
|
-
height:
|
|
1877
|
+
left: Math.round(t * an - E.x),
|
|
1878
|
+
top: Math.round(e * an - E.y),
|
|
1879
|
+
width: an,
|
|
1880
|
+
height: an,
|
|
1549
1881
|
userSelect: "none",
|
|
1550
1882
|
pointerEvents: "none"
|
|
1551
1883
|
}
|
|
1552
1884
|
}, `${t}-${e}`);
|
|
1553
1885
|
})),
|
|
1554
1886
|
b.map((e, t) => {
|
|
1555
|
-
let n =
|
|
1887
|
+
let n = sn($(e.lat, 90), $(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, a = e.color || "var(--page-accent, #dc2626)", c = s === "none" || g ? null : ln($(e.lat, 90), $(e.lng, 180), s, e.title);
|
|
1556
1888
|
return /* @__PURE__ */ f(c ? "a" : "span", {
|
|
1557
1889
|
href: c || void 0,
|
|
1558
1890
|
target: c ? "_blank" : void 0,
|
|
@@ -1591,8 +1923,8 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1591
1923
|
viewBox: "0 0 24 24",
|
|
1592
1924
|
fill: a,
|
|
1593
1925
|
style: { display: "block" },
|
|
1594
|
-
children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }),
|
|
1595
|
-
d:
|
|
1926
|
+
children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), fn[e.icon] ? /* @__PURE__ */ d("path", {
|
|
1927
|
+
d: fn[e.icon],
|
|
1596
1928
|
transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
|
|
1597
1929
|
fill: "none",
|
|
1598
1930
|
stroke: "#fff",
|
|
@@ -1628,7 +1960,7 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1628
1960
|
})
|
|
1629
1961
|
]
|
|
1630
1962
|
}), u ? /* @__PURE__ */ d("a", {
|
|
1631
|
-
href:
|
|
1963
|
+
href: un(x.lat, x.lng, C),
|
|
1632
1964
|
target: "_blank",
|
|
1633
1965
|
rel: "noopener noreferrer",
|
|
1634
1966
|
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
@@ -1642,7 +1974,7 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1642
1974
|
}) : null]
|
|
1643
1975
|
});
|
|
1644
1976
|
}
|
|
1645
|
-
var
|
|
1977
|
+
var fn = {
|
|
1646
1978
|
check: "M4 12l5 5L20 6",
|
|
1647
1979
|
close: "M6 6l12 12M18 6L6 18",
|
|
1648
1980
|
plus: "M12 5v14M5 12h14",
|
|
@@ -1739,8 +2071,8 @@ var Dt = {
|
|
|
1739
2071
|
droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
|
|
1740
2072
|
leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
|
|
1741
2073
|
};
|
|
1742
|
-
function
|
|
1743
|
-
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [
|
|
2074
|
+
function pn({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i = 2, color: a = "", href: o = "", target: s = "", label: c = "", style: l, nodeRef: u, inert: f }) {
|
|
2075
|
+
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [fn[e] ?? fn.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ d("svg", {
|
|
1744
2076
|
viewBox: "0 0 24 24",
|
|
1745
2077
|
width: g,
|
|
1746
2078
|
height: g,
|
|
@@ -1776,10 +2108,10 @@ function Ot({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
|
|
|
1776
2108
|
children: v
|
|
1777
2109
|
});
|
|
1778
2110
|
}
|
|
1779
|
-
function
|
|
1780
|
-
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" :
|
|
2111
|
+
function mn(e, t = {}, n = 0) {
|
|
2112
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : ot(e), a = Math.max(0, Number(n) || 0), o = [];
|
|
1781
2113
|
for (let e of r) {
|
|
1782
|
-
let n = e.data ?? e, r =
|
|
2114
|
+
let n = e.data ?? e, r = it(n, t.imageField), s = (Array.isArray(r) ? r : [r]).map((e) => e && typeof e == "object" ? e.url ?? e.src ?? "" : e).filter((e) => typeof e == "string" && e.trim()), c = t.nameField ? i(it(n, t.nameField)) : i(n.name), l = t.hrefField ? i(it(n, t.hrefField)) : "";
|
|
1783
2115
|
for (let e of s) if (o.push({
|
|
1784
2116
|
src: e,
|
|
1785
2117
|
name: c,
|
|
@@ -1789,8 +2121,8 @@ function kt(e, t = {}, n = 0) {
|
|
|
1789
2121
|
}
|
|
1790
2122
|
return o;
|
|
1791
2123
|
}
|
|
1792
|
-
function
|
|
1793
|
-
let { tenant: x, apiUrl: S } = i(
|
|
2124
|
+
function hn({ images: e = [], source: t = "", entry: n = "", imageField: r = "", nameField: o = "", hrefField: s = "", limit: c = 0, emptyText: p = "", columns: m = 3, gap: h = 8, showNames: g = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
|
|
2125
|
+
let { tenant: x, apiUrl: S } = i(Q), C = i(Qe)?.[t], [w, T] = l(null), [E, D] = l(() => /* @__PURE__ */ new Set());
|
|
1794
2126
|
a(() => {
|
|
1795
2127
|
if (!t || C) return;
|
|
1796
2128
|
let e = !0;
|
|
@@ -1807,7 +2139,7 @@ function At({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1807
2139
|
C
|
|
1808
2140
|
]);
|
|
1809
2141
|
let O = C ?? w ?? [], k = n ? O.filter((e) => e?.id === n || e?.data?.slug === n || e?.slug === n) : O, A = Math.max(0, Number(c) || 0), j = t ? (() => {
|
|
1810
|
-
let e =
|
|
2142
|
+
let e = mn(k, {
|
|
1811
2143
|
imageField: r,
|
|
1812
2144
|
nameField: o,
|
|
1813
2145
|
hrefField: s
|
|
@@ -2012,20 +2344,20 @@ function At({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
2012
2344
|
]
|
|
2013
2345
|
});
|
|
2014
2346
|
}
|
|
2015
|
-
var
|
|
2347
|
+
var gn = {
|
|
2016
2348
|
color: "inherit",
|
|
2017
2349
|
textDecoration: "none",
|
|
2018
2350
|
fontSize: 14,
|
|
2019
2351
|
opacity: .85
|
|
2020
|
-
},
|
|
2352
|
+
}, _n = {
|
|
2021
2353
|
background: "var(--page-surface, #f2f2f2)",
|
|
2022
2354
|
color: "var(--page-text, #111827)",
|
|
2023
2355
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
2024
2356
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
2025
2357
|
zIndex: 60
|
|
2026
2358
|
};
|
|
2027
|
-
function
|
|
2028
|
-
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], i = (e) => Array.isArray(e) ? e[0] : e, a = (e) => e == null ? "" :
|
|
2359
|
+
function vn(e, t = {}, n = "dropdown") {
|
|
2360
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], i = (e) => Array.isArray(e) ? e[0] : e, a = (e) => e == null ? "" : ot(e), o = r.map((e) => {
|
|
2029
2361
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
2030
2362
|
return {
|
|
2031
2363
|
key: e.id,
|
|
@@ -2066,8 +2398,8 @@ function Nt(e, t = {}, n = "dropdown") {
|
|
|
2066
2398
|
type: e.children.length ? n : "link"
|
|
2067
2399
|
}));
|
|
2068
2400
|
}
|
|
2069
|
-
function
|
|
2070
|
-
let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(
|
|
2401
|
+
function yn({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], style: c, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
|
|
2402
|
+
let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(Q), N = i(Qe)?.[g], [F, I] = l(null);
|
|
2071
2403
|
a(() => {
|
|
2072
2404
|
if (!g || N) return;
|
|
2073
2405
|
let e = !0;
|
|
@@ -2087,7 +2419,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2087
2419
|
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
2088
2420
|
return e.observe(C), () => e.disconnect();
|
|
2089
2421
|
}, [C, h]);
|
|
2090
|
-
let L = g ?
|
|
2422
|
+
let L = g ? vn(N ?? F ?? [], {
|
|
2091
2423
|
labelField: _,
|
|
2092
2424
|
hrefField: v,
|
|
2093
2425
|
imageField: y,
|
|
@@ -2116,7 +2448,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2116
2448
|
return /* @__PURE__ */ f("a", {
|
|
2117
2449
|
href: e.href || "#",
|
|
2118
2450
|
style: {
|
|
2119
|
-
...
|
|
2451
|
+
...gn,
|
|
2120
2452
|
display: n ? "block" : "flex",
|
|
2121
2453
|
alignItems: n ? void 0 : "center",
|
|
2122
2454
|
gap: n ? void 0 : 10,
|
|
@@ -2213,7 +2545,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2213
2545
|
let t = e.children ?? [];
|
|
2214
2546
|
if (!t.length) return /* @__PURE__ */ d("a", {
|
|
2215
2547
|
href: e.href || "#",
|
|
2216
|
-
style:
|
|
2548
|
+
style: gn,
|
|
2217
2549
|
children: e.label
|
|
2218
2550
|
}, e.key);
|
|
2219
2551
|
let n = e.type === "mega";
|
|
@@ -2227,7 +2559,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2227
2559
|
children: [/* @__PURE__ */ f("a", {
|
|
2228
2560
|
href: e.href || "#",
|
|
2229
2561
|
style: {
|
|
2230
|
-
...
|
|
2562
|
+
...gn,
|
|
2231
2563
|
cursor: "pointer"
|
|
2232
2564
|
},
|
|
2233
2565
|
children: [
|
|
@@ -2243,7 +2575,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2243
2575
|
]
|
|
2244
2576
|
}), k === e.key && (n ? /* @__PURE__ */ d("div", {
|
|
2245
2577
|
style: {
|
|
2246
|
-
...
|
|
2578
|
+
..._n,
|
|
2247
2579
|
position: "absolute",
|
|
2248
2580
|
left: 0,
|
|
2249
2581
|
right: 0,
|
|
@@ -2259,7 +2591,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2259
2591
|
}, !0))
|
|
2260
2592
|
}) : /* @__PURE__ */ d("div", {
|
|
2261
2593
|
style: {
|
|
2262
|
-
...
|
|
2594
|
+
..._n,
|
|
2263
2595
|
position: "absolute",
|
|
2264
2596
|
top: "100%",
|
|
2265
2597
|
left: 0,
|
|
@@ -2288,7 +2620,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2288
2620
|
children: L.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
|
|
2289
2621
|
href: e.href || "#",
|
|
2290
2622
|
style: {
|
|
2291
|
-
...
|
|
2623
|
+
...gn,
|
|
2292
2624
|
padding: "10px 4px",
|
|
2293
2625
|
fontWeight: (e.children ?? []).length ? 600 : 400,
|
|
2294
2626
|
opacity: 1
|
|
@@ -2299,7 +2631,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2299
2631
|
]
|
|
2300
2632
|
});
|
|
2301
2633
|
}
|
|
2302
|
-
function
|
|
2634
|
+
function bn({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
2303
2635
|
let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
2304
2636
|
return e.length ? /* @__PURE__ */ f("div", {
|
|
2305
2637
|
ref: r,
|
|
@@ -2339,13 +2671,13 @@ function Ft({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
2339
2671
|
}, e.key))]
|
|
2340
2672
|
}) : null;
|
|
2341
2673
|
}
|
|
2342
|
-
function
|
|
2674
|
+
function xn({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: c, openColor: u, borderColor: p, style: m, nodeRef: h }) {
|
|
2343
2675
|
let [g, _] = l(() => new Set(e.length ? [e[0].key] : []));
|
|
2344
2676
|
if (!e.length) return null;
|
|
2345
2677
|
let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
|
|
2346
2678
|
let n = Number(e);
|
|
2347
2679
|
return e === "" || e == null || !Number.isFinite(n) ? t : n;
|
|
2348
|
-
}, b =
|
|
2680
|
+
}, b = fn[r], x = (e) => _((t) => {
|
|
2349
2681
|
let r = new Set(n ? t : []);
|
|
2350
2682
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
2351
2683
|
});
|
|
@@ -2420,15 +2752,15 @@ function It({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
|
|
|
2420
2752
|
})
|
|
2421
2753
|
});
|
|
2422
2754
|
}
|
|
2423
|
-
var
|
|
2755
|
+
var Sn = {
|
|
2424
2756
|
display: "flex",
|
|
2425
2757
|
flexDirection: "column",
|
|
2426
2758
|
gap: "12px"
|
|
2427
|
-
},
|
|
2759
|
+
}, Cn = {
|
|
2428
2760
|
fontSize: "14px",
|
|
2429
2761
|
fontWeight: 500,
|
|
2430
2762
|
color: "var(--page-text, #111827)"
|
|
2431
|
-
},
|
|
2763
|
+
}, wn = {
|
|
2432
2764
|
padding: "10px 12px",
|
|
2433
2765
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
2434
2766
|
borderRadius: "6px",
|
|
@@ -2438,18 +2770,18 @@ var Lt = {
|
|
|
2438
2770
|
boxSizing: "border-box",
|
|
2439
2771
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
2440
2772
|
color: "var(--page-text, #111827)"
|
|
2441
|
-
},
|
|
2773
|
+
}, Tn = {
|
|
2442
2774
|
display: "flex",
|
|
2443
2775
|
alignItems: "center",
|
|
2444
2776
|
gap: "8px",
|
|
2445
2777
|
fontSize: "14px",
|
|
2446
2778
|
color: "var(--page-text, #111827)"
|
|
2447
|
-
},
|
|
2779
|
+
}, En = (e) => e ? {
|
|
2448
2780
|
readOnly: !0,
|
|
2449
2781
|
tabIndex: -1,
|
|
2450
2782
|
onMouseDown: (e) => e.preventDefault()
|
|
2451
2783
|
} : {};
|
|
2452
|
-
function
|
|
2784
|
+
function Dn(e, t) {
|
|
2453
2785
|
if (!e) return !0;
|
|
2454
2786
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
2455
2787
|
switch (e.op) {
|
|
@@ -2463,11 +2795,11 @@ function Ht(e, t) {
|
|
|
2463
2795
|
default: return !1;
|
|
2464
2796
|
}
|
|
2465
2797
|
}
|
|
2466
|
-
var
|
|
2798
|
+
var On = {
|
|
2467
2799
|
display: "flex",
|
|
2468
2800
|
flexDirection: "column",
|
|
2469
2801
|
gap: 6
|
|
2470
|
-
},
|
|
2802
|
+
}, kn = {
|
|
2471
2803
|
font: "inherit",
|
|
2472
2804
|
fontSize: 15,
|
|
2473
2805
|
padding: "10px 12px",
|
|
@@ -2478,17 +2810,17 @@ var Ut = {
|
|
|
2478
2810
|
width: "100%",
|
|
2479
2811
|
boxSizing: "border-box"
|
|
2480
2812
|
};
|
|
2481
|
-
function
|
|
2813
|
+
function An(e, t) {
|
|
2482
2814
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
2483
2815
|
if (!e?.parentField) return n;
|
|
2484
2816
|
let r = t?.[e.parentField];
|
|
2485
2817
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
2486
2818
|
}
|
|
2487
|
-
var
|
|
2488
|
-
function
|
|
2819
|
+
var jn = "g-recaptcha-response", Mn = (e) => e?.type === "recaptcha" ? jn : e?.name;
|
|
2820
|
+
function Nn({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
2489
2821
|
let a = /* @__PURE__ */ f("span", {
|
|
2490
2822
|
style: {
|
|
2491
|
-
...
|
|
2823
|
+
...Cn,
|
|
2492
2824
|
fontSize: 14
|
|
2493
2825
|
},
|
|
2494
2826
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -2497,7 +2829,7 @@ function Jt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2497
2829
|
required: e.required || void 0,
|
|
2498
2830
|
placeholder: e.placeholder || void 0,
|
|
2499
2831
|
disabled: r || void 0,
|
|
2500
|
-
style:
|
|
2832
|
+
style: kn,
|
|
2501
2833
|
value: t ?? "",
|
|
2502
2834
|
onChange: (t) => n(e.name, t.target.value)
|
|
2503
2835
|
};
|
|
@@ -2526,12 +2858,12 @@ function Jt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2526
2858
|
borderRadius: 8,
|
|
2527
2859
|
display: "block"
|
|
2528
2860
|
}
|
|
2529
|
-
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(
|
|
2861
|
+
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(Rn, {
|
|
2530
2862
|
theme: e.captchaTheme,
|
|
2531
2863
|
size: e.captchaSize,
|
|
2532
2864
|
inert: r,
|
|
2533
|
-
onChange: (e) => n(
|
|
2534
|
-
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(
|
|
2865
|
+
onChange: (e) => n(jn, e)
|
|
2866
|
+
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(Ut, {
|
|
2535
2867
|
url: e.src,
|
|
2536
2868
|
style: { width: "100%" }
|
|
2537
2869
|
}) : /* @__PURE__ */ d("video", {
|
|
@@ -2543,14 +2875,14 @@ function Jt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2543
2875
|
display: "block"
|
|
2544
2876
|
}
|
|
2545
2877
|
}) : null : /* @__PURE__ */ f("label", {
|
|
2546
|
-
style:
|
|
2878
|
+
style: On,
|
|
2547
2879
|
children: [
|
|
2548
2880
|
a,
|
|
2549
2881
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
|
|
2550
2882
|
...o,
|
|
2551
2883
|
rows: 4,
|
|
2552
2884
|
style: {
|
|
2553
|
-
...
|
|
2885
|
+
...kn,
|
|
2554
2886
|
resize: "vertical"
|
|
2555
2887
|
}
|
|
2556
2888
|
}) : e.type === "select" ? /* @__PURE__ */ f("select", {
|
|
@@ -2559,7 +2891,7 @@ function Jt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2559
2891
|
children: [/* @__PURE__ */ d("option", {
|
|
2560
2892
|
value: "",
|
|
2561
2893
|
children: e.placeholder || "—"
|
|
2562
|
-
}),
|
|
2894
|
+
}), An(e, i).map((e, t) => /* @__PURE__ */ d("option", {
|
|
2563
2895
|
value: typeof e == "string" ? e : e.value,
|
|
2564
2896
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
2565
2897
|
}, t))]
|
|
@@ -2606,8 +2938,8 @@ function Jt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2606
2938
|
]
|
|
2607
2939
|
});
|
|
2608
2940
|
}
|
|
2609
|
-
function
|
|
2610
|
-
let { tenant: y, apiUrl: b } = i(
|
|
2941
|
+
function Pn({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s, auto: c, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
|
|
2942
|
+
let { tenant: y, apiUrl: b } = i(Q), [x, S] = l("form"), [C, w] = l(null), [T, E] = l({}), [D, O] = l(0), k = h ? v || "form" : x;
|
|
2611
2943
|
a(() => {
|
|
2612
2944
|
if (!c || !s) return;
|
|
2613
2945
|
let e = !0;
|
|
@@ -2628,11 +2960,11 @@ function Yt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2628
2960
|
section: e,
|
|
2629
2961
|
fields: []
|
|
2630
2962
|
}) : A[A.length - 1].fields.push(e);
|
|
2631
|
-
let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section ||
|
|
2963
|
+
let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section || Dn(e.section.condition, T)).map((e) => ({
|
|
2632
2964
|
...e,
|
|
2633
|
-
fields: e.fields.filter((e) =>
|
|
2965
|
+
fields: e.fields.filter((e) => Dn(e.condition, T))
|
|
2634
2966
|
})), N = j.length > 1, F = Math.min(D, Math.max(0, M.length - 1)), I = N ? M[F]?.fields ?? [] : M.flatMap((e) => e.fields), L = I.filter((e) => {
|
|
2635
|
-
let t = T[
|
|
2967
|
+
let t = T[Mn(e)];
|
|
2636
2968
|
return e.required && (t == null || t === "" || t === !1);
|
|
2637
2969
|
}), R = F >= M.length - 1, z = (e, t) => E((n) => {
|
|
2638
2970
|
let r = {
|
|
@@ -2688,11 +3020,11 @@ function Yt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2688
3020
|
}
|
|
2689
3021
|
},
|
|
2690
3022
|
style: {
|
|
2691
|
-
...
|
|
3023
|
+
...Sn,
|
|
2692
3024
|
display: k === "success" ? "none" : "flex"
|
|
2693
3025
|
},
|
|
2694
3026
|
children: c && s ? /* @__PURE__ */ f(u, { children: [
|
|
2695
|
-
N && /* @__PURE__ */ d(
|
|
3027
|
+
N && /* @__PURE__ */ d(pr, {
|
|
2696
3028
|
steps: M.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2697
3029
|
active: F + 1,
|
|
2698
3030
|
style: { marginBottom: 8 }
|
|
@@ -2705,9 +3037,9 @@ function Yt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2705
3037
|
},
|
|
2706
3038
|
children: M[F].section.help
|
|
2707
3039
|
}),
|
|
2708
|
-
I.map((e) => /* @__PURE__ */ d(
|
|
3040
|
+
I.map((e) => /* @__PURE__ */ d(Nn, {
|
|
2709
3041
|
field: e,
|
|
2710
|
-
value: T[
|
|
3042
|
+
value: T[Mn(e)],
|
|
2711
3043
|
values: T,
|
|
2712
3044
|
onChange: z,
|
|
2713
3045
|
inert: h
|
|
@@ -2724,7 +3056,7 @@ function Yt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2724
3056
|
disabled: h || void 0,
|
|
2725
3057
|
onClick: () => O(F - 1),
|
|
2726
3058
|
style: {
|
|
2727
|
-
...
|
|
3059
|
+
...ft,
|
|
2728
3060
|
background: "transparent",
|
|
2729
3061
|
color: "inherit",
|
|
2730
3062
|
border: 0,
|
|
@@ -2737,7 +3069,7 @@ function Yt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2737
3069
|
disabled: h || L.length > 0,
|
|
2738
3070
|
onClick: () => O(F + 1),
|
|
2739
3071
|
style: {
|
|
2740
|
-
...
|
|
3072
|
+
...ft,
|
|
2741
3073
|
border: 0,
|
|
2742
3074
|
padding: "10px 22px",
|
|
2743
3075
|
borderRadius: 8,
|
|
@@ -2751,7 +3083,7 @@ function Yt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2751
3083
|
type: "submit",
|
|
2752
3084
|
disabled: h || void 0,
|
|
2753
3085
|
style: {
|
|
2754
|
-
...
|
|
3086
|
+
...ft,
|
|
2755
3087
|
border: 0,
|
|
2756
3088
|
padding: "10px 22px",
|
|
2757
3089
|
borderRadius: 8,
|
|
@@ -2778,10 +3110,10 @@ function Yt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2778
3110
|
]
|
|
2779
3111
|
});
|
|
2780
3112
|
}
|
|
2781
|
-
var
|
|
3113
|
+
var Fn = null, In = null, Ln = (e) => {
|
|
2782
3114
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2783
|
-
if (
|
|
2784
|
-
if (
|
|
3115
|
+
if (Fn && In === t) return Fn;
|
|
3116
|
+
if (Fn && typeof window < "u") {
|
|
2785
3117
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2786
3118
|
delete window[e];
|
|
2787
3119
|
} catch {
|
|
@@ -2789,22 +3121,22 @@ var Xt = null, Zt = null, Qt = (e) => {
|
|
|
2789
3121
|
}
|
|
2790
3122
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2791
3123
|
}
|
|
2792
|
-
return
|
|
3124
|
+
return In = t, Fn = new Promise((e) => {
|
|
2793
3125
|
if (typeof window > "u") return;
|
|
2794
3126
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2795
3127
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2796
3128
|
let n = document.createElement("script");
|
|
2797
3129
|
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
2798
|
-
}),
|
|
3130
|
+
}), Fn;
|
|
2799
3131
|
};
|
|
2800
|
-
function
|
|
2801
|
-
let p = i(
|
|
3132
|
+
function Rn({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l, onChange: u }) {
|
|
3133
|
+
let p = i(Q), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = c(null), _ = c(u);
|
|
2802
3134
|
if (_.current = u, a(() => {
|
|
2803
3135
|
if (l || !h || !g.current) return;
|
|
2804
3136
|
let e = !0, i = (t) => {
|
|
2805
3137
|
e && typeof _.current == "function" && _.current(t);
|
|
2806
3138
|
};
|
|
2807
|
-
return
|
|
3139
|
+
return Ln(r).then((r) => {
|
|
2808
3140
|
if (!(!e || !g.current || !r?.render)) {
|
|
2809
3141
|
g.current.innerHTML = "", i("");
|
|
2810
3142
|
try {
|
|
@@ -2886,17 +3218,17 @@ function $t({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert:
|
|
|
2886
3218
|
children: /* @__PURE__ */ d("div", { ref: g })
|
|
2887
3219
|
}) : null;
|
|
2888
3220
|
}
|
|
2889
|
-
function
|
|
3221
|
+
function zn({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2890
3222
|
return /* @__PURE__ */ d("label", {
|
|
2891
3223
|
ref: r,
|
|
2892
3224
|
style: {
|
|
2893
|
-
...
|
|
3225
|
+
...Cn,
|
|
2894
3226
|
...P(n)
|
|
2895
3227
|
},
|
|
2896
|
-
children:
|
|
3228
|
+
children: wt(t, e, i)
|
|
2897
3229
|
});
|
|
2898
3230
|
}
|
|
2899
|
-
function
|
|
3231
|
+
function Bn({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2900
3232
|
return /* @__PURE__ */ d("input", {
|
|
2901
3233
|
ref: a,
|
|
2902
3234
|
type: e,
|
|
@@ -2904,13 +3236,13 @@ function tn({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2904
3236
|
placeholder: n,
|
|
2905
3237
|
required: !o && !!r,
|
|
2906
3238
|
style: {
|
|
2907
|
-
...
|
|
3239
|
+
...wn,
|
|
2908
3240
|
...P(i)
|
|
2909
3241
|
},
|
|
2910
|
-
...
|
|
3242
|
+
...En(o)
|
|
2911
3243
|
});
|
|
2912
3244
|
}
|
|
2913
|
-
function
|
|
3245
|
+
function Vn({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2914
3246
|
return /* @__PURE__ */ d("textarea", {
|
|
2915
3247
|
ref: a,
|
|
2916
3248
|
name: e || void 0,
|
|
@@ -2918,18 +3250,18 @@ function nn({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2918
3250
|
rows: n,
|
|
2919
3251
|
required: !o && !!r,
|
|
2920
3252
|
style: {
|
|
2921
|
-
...
|
|
3253
|
+
...wn,
|
|
2922
3254
|
resize: "vertical",
|
|
2923
3255
|
...P(i)
|
|
2924
3256
|
},
|
|
2925
|
-
...
|
|
3257
|
+
...En(o)
|
|
2926
3258
|
});
|
|
2927
3259
|
}
|
|
2928
|
-
function
|
|
3260
|
+
function Hn({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2929
3261
|
return /* @__PURE__ */ f("label", {
|
|
2930
3262
|
ref: o,
|
|
2931
3263
|
style: {
|
|
2932
|
-
...
|
|
3264
|
+
...Tn,
|
|
2933
3265
|
...P(a)
|
|
2934
3266
|
},
|
|
2935
3267
|
children: [/* @__PURE__ */ d("input", {
|
|
@@ -2946,7 +3278,7 @@ function rn({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
2946
3278
|
}), t]
|
|
2947
3279
|
});
|
|
2948
3280
|
}
|
|
2949
|
-
function
|
|
3281
|
+
function Un({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
2950
3282
|
return /* @__PURE__ */ f("select", {
|
|
2951
3283
|
ref: a,
|
|
2952
3284
|
name: e || void 0,
|
|
@@ -2955,7 +3287,7 @@ function an({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2955
3287
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
2956
3288
|
tabIndex: o ? -1 : void 0,
|
|
2957
3289
|
style: {
|
|
2958
|
-
...
|
|
3290
|
+
...wn,
|
|
2959
3291
|
appearance: "auto",
|
|
2960
3292
|
...P(i)
|
|
2961
3293
|
},
|
|
@@ -2969,12 +3301,12 @@ function an({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2969
3301
|
}, t))]
|
|
2970
3302
|
});
|
|
2971
3303
|
}
|
|
2972
|
-
function
|
|
3304
|
+
function Wn({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
2973
3305
|
let [s, c] = l(null);
|
|
2974
3306
|
return /* @__PURE__ */ f("label", {
|
|
2975
3307
|
ref: a,
|
|
2976
3308
|
style: {
|
|
2977
|
-
...
|
|
3309
|
+
...wn,
|
|
2978
3310
|
display: "flex",
|
|
2979
3311
|
alignItems: "center",
|
|
2980
3312
|
gap: "8px",
|
|
@@ -3001,12 +3333,12 @@ function on({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
3001
3333
|
]
|
|
3002
3334
|
});
|
|
3003
3335
|
}
|
|
3004
|
-
function
|
|
3336
|
+
function Gn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
3005
3337
|
return /* @__PURE__ */ d("button", {
|
|
3006
3338
|
ref: n,
|
|
3007
3339
|
type: r ? "button" : "submit",
|
|
3008
3340
|
style: {
|
|
3009
|
-
...
|
|
3341
|
+
...ft,
|
|
3010
3342
|
border: 0,
|
|
3011
3343
|
cursor: "pointer",
|
|
3012
3344
|
alignSelf: "flex-start",
|
|
@@ -3021,7 +3353,7 @@ function sn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
3021
3353
|
children: e
|
|
3022
3354
|
});
|
|
3023
3355
|
}
|
|
3024
|
-
function
|
|
3356
|
+
function Kn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
3025
3357
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
3026
3358
|
return /* @__PURE__ */ d("div", {
|
|
3027
3359
|
ref: r,
|
|
@@ -3038,8 +3370,8 @@ function cn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
3038
3370
|
}, t))
|
|
3039
3371
|
});
|
|
3040
3372
|
}
|
|
3041
|
-
function
|
|
3042
|
-
let { tenant: v, apiUrl: y, locale: b } = i(
|
|
3373
|
+
function qn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
|
|
3374
|
+
let { tenant: v, apiUrl: y, locale: b } = i(Q), x = i(nt), S = i(Qe), [, C] = l(0);
|
|
3043
3375
|
a(() => {
|
|
3044
3376
|
if (typeof window > "u") return;
|
|
3045
3377
|
let e = () => C((e) => e + 1);
|
|
@@ -3047,7 +3379,7 @@ function ln({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3047
3379
|
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
3048
3380
|
};
|
|
3049
3381
|
}, []);
|
|
3050
|
-
let w =
|
|
3382
|
+
let w = tt(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? $e(S) : 1, [k, A] = l(null);
|
|
3051
3383
|
if (a(() => {
|
|
3052
3384
|
if (!e || D) return;
|
|
3053
3385
|
let n = !0, r = new URLSearchParams();
|
|
@@ -3092,7 +3424,7 @@ function ln({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3092
3424
|
},
|
|
3093
3425
|
children: M.map((e) => /* @__PURE__ */ d("div", {
|
|
3094
3426
|
style: { minWidth: 0 },
|
|
3095
|
-
children: x.render(p, (t) =>
|
|
3427
|
+
children: x.render(p, (t) => st(t, e))
|
|
3096
3428
|
}, e.id ?? e?.data?.slug))
|
|
3097
3429
|
}) : /* @__PURE__ */ d("div", {
|
|
3098
3430
|
ref: _,
|
|
@@ -3102,7 +3434,7 @@ function ln({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3102
3434
|
...P(g)
|
|
3103
3435
|
},
|
|
3104
3436
|
children: M.map((e) => {
|
|
3105
|
-
let t = o ?
|
|
3437
|
+
let t = o ? it(e?.data, o) : null, r = s ? ot(it(e?.data, s)) : null, i = c ? it(e?.data, c) : null, a = Array.isArray(i) ? i : null, l = a || i == null ? null : ot(i), u = n === "list";
|
|
3106
3438
|
return /* @__PURE__ */ f("div", {
|
|
3107
3439
|
style: {
|
|
3108
3440
|
display: "flex",
|
|
@@ -3149,7 +3481,7 @@ function ln({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3149
3481
|
lineHeight: 1.55,
|
|
3150
3482
|
opacity: .85
|
|
3151
3483
|
},
|
|
3152
|
-
children:
|
|
3484
|
+
children: At(a)
|
|
3153
3485
|
})
|
|
3154
3486
|
]
|
|
3155
3487
|
})]
|
|
@@ -3157,8 +3489,8 @@ function ln({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3157
3489
|
})
|
|
3158
3490
|
});
|
|
3159
3491
|
}
|
|
3160
|
-
function
|
|
3161
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
3492
|
+
function Jn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
3493
|
+
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : et(), s = {
|
|
3162
3494
|
height: 34,
|
|
3163
3495
|
padding: "0 12px",
|
|
3164
3496
|
borderRadius: 8,
|
|
@@ -3206,7 +3538,7 @@ function un({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3206
3538
|
name: `f_${e.name}`,
|
|
3207
3539
|
defaultValue: o[e.name] ?? "",
|
|
3208
3540
|
style: s,
|
|
3209
|
-
...
|
|
3541
|
+
...En(i),
|
|
3210
3542
|
children: [/* @__PURE__ */ d("option", {
|
|
3211
3543
|
value: "",
|
|
3212
3544
|
children: e.label || e.name
|
|
@@ -3221,7 +3553,7 @@ function un({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3221
3553
|
name: `f_${e.name}`,
|
|
3222
3554
|
defaultValue: o[e.name] ?? "",
|
|
3223
3555
|
style: s,
|
|
3224
|
-
...
|
|
3556
|
+
...En(i),
|
|
3225
3557
|
children: [
|
|
3226
3558
|
/* @__PURE__ */ d("option", {
|
|
3227
3559
|
value: "",
|
|
@@ -3242,7 +3574,7 @@ function un({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3242
3574
|
defaultValue: o[e.name] ?? "",
|
|
3243
3575
|
placeholder: e.label || e.name,
|
|
3244
3576
|
style: s,
|
|
3245
|
-
...
|
|
3577
|
+
...En(i)
|
|
3246
3578
|
}, e.name)), /* @__PURE__ */ d("button", {
|
|
3247
3579
|
type: "submit",
|
|
3248
3580
|
style: {
|
|
@@ -3255,12 +3587,12 @@ function un({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3255
3587
|
fontWeight: 600,
|
|
3256
3588
|
cursor: i ? "default" : "pointer"
|
|
3257
3589
|
},
|
|
3258
|
-
...
|
|
3590
|
+
...En(i),
|
|
3259
3591
|
children: t
|
|
3260
3592
|
})]
|
|
3261
3593
|
});
|
|
3262
3594
|
}
|
|
3263
|
-
function
|
|
3595
|
+
function Yn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
3264
3596
|
return e.length ? /* @__PURE__ */ d("nav", {
|
|
3265
3597
|
ref: r,
|
|
3266
3598
|
"aria-label": "Breadcrumb",
|
|
@@ -3310,8 +3642,8 @@ function dn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
3310
3642
|
})
|
|
3311
3643
|
}) : null;
|
|
3312
3644
|
}
|
|
3313
|
-
function
|
|
3314
|
-
let { tenant: g, apiUrl: _ } = i(
|
|
3645
|
+
function Xn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", source: o, pageSize: s = 6, align: c, hideEmpty: u, inert: p, style: m, nodeRef: h }) {
|
|
3646
|
+
let { tenant: g, apiUrl: _ } = i(Q), v = i(Qe), [y, b] = l(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
3315
3647
|
a(() => {
|
|
3316
3648
|
if (!o || Number.isFinite(x)) return;
|
|
3317
3649
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -3330,7 +3662,7 @@ function fn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
3330
3662
|
]);
|
|
3331
3663
|
let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
|
|
3332
3664
|
if (o && C === null || o && u && !(C > 0)) return null;
|
|
3333
|
-
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ?
|
|
3665
|
+
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? $e(v) : Number(t) || 1, 1), w), E = (e) => {
|
|
3334
3666
|
if (o) {
|
|
3335
3667
|
if (typeof window < "u") {
|
|
3336
3668
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -3395,15 +3727,15 @@ function fn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
3395
3727
|
]
|
|
3396
3728
|
});
|
|
3397
3729
|
}
|
|
3398
|
-
var
|
|
3730
|
+
var Zn = "webim.page_mode", Qn = () => {
|
|
3399
3731
|
if (typeof window > "u") return "auto";
|
|
3400
3732
|
try {
|
|
3401
|
-
let e = window.localStorage.getItem(
|
|
3733
|
+
let e = window.localStorage.getItem(Zn);
|
|
3402
3734
|
return e === "light" || e === "dark" ? e : "auto";
|
|
3403
3735
|
} catch {
|
|
3404
3736
|
return "auto";
|
|
3405
3737
|
}
|
|
3406
|
-
},
|
|
3738
|
+
}, $n = (e) => {
|
|
3407
3739
|
let t = {
|
|
3408
3740
|
width: 16,
|
|
3409
3741
|
height: 16,
|
|
@@ -3435,13 +3767,13 @@ var pn = "webim.page_mode", mn = () => {
|
|
|
3435
3767
|
rx: "2"
|
|
3436
3768
|
}), /* @__PURE__ */ d("path", { d: "M8 21h8M12 17v4" })]
|
|
3437
3769
|
});
|
|
3438
|
-
},
|
|
3770
|
+
}, er = {
|
|
3439
3771
|
light: "Light theme",
|
|
3440
3772
|
dark: "Dark theme",
|
|
3441
3773
|
auto: "Follow the device theme"
|
|
3442
3774
|
};
|
|
3443
|
-
function
|
|
3444
|
-
let [o, s] = l(i ? "auto" :
|
|
3775
|
+
function tr({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
3776
|
+
let [o, s] = l(i ? "auto" : Qn), u = c(null), f = (e) => {
|
|
3445
3777
|
u.current = e, typeof r == "function" && r(e);
|
|
3446
3778
|
};
|
|
3447
3779
|
a(() => {
|
|
@@ -3449,7 +3781,7 @@ function _n({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3449
3781
|
let e = u.current?.closest?.(".webim-page");
|
|
3450
3782
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
3451
3783
|
try {
|
|
3452
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
3784
|
+
o === "auto" ? window.localStorage.removeItem(Zn) : window.localStorage.setItem(Zn, o);
|
|
3453
3785
|
} catch {}
|
|
3454
3786
|
}, [o, i]);
|
|
3455
3787
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -3484,8 +3816,8 @@ function _n({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3484
3816
|
},
|
|
3485
3817
|
children: p.map((e) => /* @__PURE__ */ d("button", {
|
|
3486
3818
|
type: "button",
|
|
3487
|
-
title:
|
|
3488
|
-
"aria-label":
|
|
3819
|
+
title: er[e],
|
|
3820
|
+
"aria-label": er[e],
|
|
3489
3821
|
"aria-pressed": e === m,
|
|
3490
3822
|
onClick: i ? void 0 : () => s(e),
|
|
3491
3823
|
style: {
|
|
@@ -3496,15 +3828,15 @@ function _n({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3496
3828
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
3497
3829
|
opacity: e === m ? 1 : .7
|
|
3498
3830
|
},
|
|
3499
|
-
children:
|
|
3831
|
+
children: $n(e)
|
|
3500
3832
|
}, e))
|
|
3501
3833
|
});
|
|
3502
3834
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
3503
3835
|
return /* @__PURE__ */ d("button", {
|
|
3504
3836
|
ref: f,
|
|
3505
3837
|
type: "button",
|
|
3506
|
-
title:
|
|
3507
|
-
"aria-label": `Theme: ${
|
|
3838
|
+
title: er[m],
|
|
3839
|
+
"aria-label": `Theme: ${er[m]} — switch to ${er[g]}`,
|
|
3508
3840
|
onClick: i ? void 0 : () => s(g),
|
|
3509
3841
|
style: {
|
|
3510
3842
|
...h,
|
|
@@ -3513,10 +3845,10 @@ function _n({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3513
3845
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
3514
3846
|
...P(n)
|
|
3515
3847
|
},
|
|
3516
|
-
children:
|
|
3848
|
+
children: $n(m)
|
|
3517
3849
|
});
|
|
3518
3850
|
}
|
|
3519
|
-
function
|
|
3851
|
+
function nr(e) {
|
|
3520
3852
|
let t = e?.parentElement;
|
|
3521
3853
|
for (; t && t !== document.body;) {
|
|
3522
3854
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -3525,7 +3857,7 @@ function vn(e) {
|
|
|
3525
3857
|
}
|
|
3526
3858
|
return window;
|
|
3527
3859
|
}
|
|
3528
|
-
var
|
|
3860
|
+
var rr = (e) => e === window ? window.scrollY : e.scrollTop, ir = {
|
|
3529
3861
|
"bottom-right": (e) => ({
|
|
3530
3862
|
right: e,
|
|
3531
3863
|
bottom: e
|
|
@@ -3539,8 +3871,122 @@ var yn = (e) => e === window ? window.scrollY : e.scrollTop, bn = {
|
|
|
3539
3871
|
bottom: e,
|
|
3540
3872
|
transform: "translateX(-50%)"
|
|
3541
3873
|
})
|
|
3874
|
+
}, ar = {
|
|
3875
|
+
linear: (e) => e,
|
|
3876
|
+
out: (e) => 1 - (1 - e) ** 3,
|
|
3877
|
+
inout: (e) => e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2
|
|
3878
|
+
}, or = (e) => {
|
|
3879
|
+
let t = e.getBoundingClientRect(), n = e.parentElement;
|
|
3880
|
+
for (; n && n !== document.body;) {
|
|
3881
|
+
let e = getComputedStyle(n);
|
|
3882
|
+
if (/(auto|scroll)/.test(e.overflowY) && n.scrollHeight > n.clientHeight) break;
|
|
3883
|
+
n = n.parentElement;
|
|
3884
|
+
}
|
|
3885
|
+
return !n || n === document.body ? Math.max(document.documentElement.scrollHeight - (t.bottom + window.scrollY), 0) : Math.max(n.scrollHeight - (t.bottom - n.getBoundingClientRect().top + n.scrollTop), 0);
|
|
3886
|
+
}, sr = (e, t) => {
|
|
3887
|
+
let n = typeof e == "number" ? e : parseFloat(e);
|
|
3888
|
+
return Number.isFinite(n) ? n : t;
|
|
3542
3889
|
};
|
|
3543
|
-
function
|
|
3890
|
+
function cr(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
|
|
3891
|
+
let i = Math.min(Math.max(Math.round(sr(n, 0)), 0), 6);
|
|
3892
|
+
try {
|
|
3893
|
+
return new Intl.NumberFormat(t || void 0, {
|
|
3894
|
+
minimumFractionDigits: i,
|
|
3895
|
+
maximumFractionDigits: i,
|
|
3896
|
+
useGrouping: r !== "none"
|
|
3897
|
+
}).format(e);
|
|
3898
|
+
} catch {
|
|
3899
|
+
return e.toFixed(i);
|
|
3900
|
+
}
|
|
3901
|
+
}
|
|
3902
|
+
function lr({ from: e, to: t, duration: n, delay: r, decimals: o, prefix: s, suffix: u, separator: p, easing: m, trigger: h, offset: g, once: _, label: v, align: y, style: b, nodeRef: x, inert: S }) {
|
|
3903
|
+
let { locale: C } = i(Q), w = Math.max(sr(g, 0), 0), T = sr(e, 0), E = sr(t, 100), [D, O] = l(E), k = c(null), [A, j] = l(!1);
|
|
3904
|
+
return a(() => {
|
|
3905
|
+
let e = k.current;
|
|
3906
|
+
if (S || !A || !e) {
|
|
3907
|
+
O(E);
|
|
3908
|
+
return;
|
|
3909
|
+
}
|
|
3910
|
+
O(T);
|
|
3911
|
+
let t = Math.max(sr(n, 2e3), 0), i = Math.max(sr(r, 0), 0), a = ar[m] || ar.out, o = typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, s = 0, c = 0, l = !1, u = () => {
|
|
3912
|
+
if (cancelAnimationFrame(s), clearTimeout(c), o || t === 0) {
|
|
3913
|
+
O(E);
|
|
3914
|
+
return;
|
|
3915
|
+
}
|
|
3916
|
+
c = setTimeout(() => {
|
|
3917
|
+
let e = performance.now(), n = (r) => {
|
|
3918
|
+
let i = Math.min((r - e) / t, 1);
|
|
3919
|
+
O(T + (E - T) * a(i)), i < 1 && (s = requestAnimationFrame(n));
|
|
3920
|
+
};
|
|
3921
|
+
s = requestAnimationFrame(n);
|
|
3922
|
+
}, i);
|
|
3923
|
+
};
|
|
3924
|
+
if (h === "load" || typeof IntersectionObserver > "u") return u(), () => {
|
|
3925
|
+
cancelAnimationFrame(s), clearTimeout(c);
|
|
3926
|
+
};
|
|
3927
|
+
let d = new IntersectionObserver((e) => {
|
|
3928
|
+
let t = e.some((e) => e.isIntersecting);
|
|
3929
|
+
t && (!l || _ === !1) ? (l = !0, u()) : !t && _ === !1 && (cancelAnimationFrame(s), clearTimeout(c), O(T));
|
|
3930
|
+
}, {
|
|
3931
|
+
rootMargin: `0px 0px -${Math.min(w, Math.floor(or(e)))}px 0px`,
|
|
3932
|
+
threshold: w > 0 ? 0 : .3
|
|
3933
|
+
});
|
|
3934
|
+
return d.observe(e), () => {
|
|
3935
|
+
d.disconnect(), cancelAnimationFrame(s), clearTimeout(c);
|
|
3936
|
+
};
|
|
3937
|
+
}, [
|
|
3938
|
+
A,
|
|
3939
|
+
S,
|
|
3940
|
+
T,
|
|
3941
|
+
E,
|
|
3942
|
+
n,
|
|
3943
|
+
r,
|
|
3944
|
+
m,
|
|
3945
|
+
h,
|
|
3946
|
+
w,
|
|
3947
|
+
_
|
|
3948
|
+
]), /* @__PURE__ */ f("div", {
|
|
3949
|
+
ref: (e) => {
|
|
3950
|
+
k.current = e, e && j(!0), typeof x == "function" && x(e);
|
|
3951
|
+
},
|
|
3952
|
+
"data-wb-counter": "",
|
|
3953
|
+
style: {
|
|
3954
|
+
display: "flex",
|
|
3955
|
+
flexDirection: "column",
|
|
3956
|
+
alignItems: y === "left" ? "flex-start" : y === "right" ? "flex-end" : "center",
|
|
3957
|
+
gap: 4,
|
|
3958
|
+
fontSize: 48,
|
|
3959
|
+
fontWeight: 700,
|
|
3960
|
+
lineHeight: 1.1,
|
|
3961
|
+
textAlign: y === "left" ? "left" : y === "right" ? "right" : "center",
|
|
3962
|
+
...P(b)
|
|
3963
|
+
},
|
|
3964
|
+
children: [/* @__PURE__ */ f("span", {
|
|
3965
|
+
style: {
|
|
3966
|
+
fontVariantNumeric: "tabular-nums",
|
|
3967
|
+
whiteSpace: "nowrap"
|
|
3968
|
+
},
|
|
3969
|
+
children: [
|
|
3970
|
+
s || "",
|
|
3971
|
+
cr(D, {
|
|
3972
|
+
locale: C,
|
|
3973
|
+
decimals: o,
|
|
3974
|
+
separator: p
|
|
3975
|
+
}),
|
|
3976
|
+
u || ""
|
|
3977
|
+
]
|
|
3978
|
+
}), v ? /* @__PURE__ */ d("span", {
|
|
3979
|
+
style: {
|
|
3980
|
+
fontSize: "0.3em",
|
|
3981
|
+
fontWeight: 400,
|
|
3982
|
+
lineHeight: 1.4,
|
|
3983
|
+
opacity: .72
|
|
3984
|
+
},
|
|
3985
|
+
children: v
|
|
3986
|
+
}) : null]
|
|
3987
|
+
});
|
|
3988
|
+
}
|
|
3989
|
+
function ur({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth: o, bg: s, fg: c, style: u, nodeRef: p, inert: m, frame: h, builder: g }) {
|
|
3544
3990
|
let [_, v] = l(!!m), [y, b] = l(null), x = (e) => {
|
|
3545
3991
|
b(e), typeof p == "function" && p(e);
|
|
3546
3992
|
};
|
|
@@ -3551,8 +3997,8 @@ function xn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3551
3997
|
}
|
|
3552
3998
|
if (!y) return;
|
|
3553
3999
|
let e = Number(i) >= 0 ? Number(i) : 300, t = () => {
|
|
3554
|
-
let t =
|
|
3555
|
-
v(n ||
|
|
4000
|
+
let t = nr(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
4001
|
+
v(n || rr(t) > e);
|
|
3556
4002
|
};
|
|
3557
4003
|
return t(), document.addEventListener("scroll", t, {
|
|
3558
4004
|
capture: !0,
|
|
@@ -3566,7 +4012,7 @@ function xn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3566
4012
|
]);
|
|
3567
4013
|
let S = () => {
|
|
3568
4014
|
if (m) return;
|
|
3569
|
-
let e =
|
|
4015
|
+
let e = nr(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
3570
4016
|
e === window ? window.scrollTo({
|
|
3571
4017
|
top: 0,
|
|
3572
4018
|
behavior: n
|
|
@@ -3574,7 +4020,7 @@ function xn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3574
4020
|
top: 0,
|
|
3575
4021
|
behavior: n
|
|
3576
4022
|
});
|
|
3577
|
-
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E =
|
|
4023
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = ir[n] ? n : "bottom-right", D = h ? {
|
|
3578
4024
|
position: "fixed",
|
|
3579
4025
|
zIndex: 5,
|
|
3580
4026
|
bottom: (h.bottom ?? 0) + C,
|
|
@@ -3587,7 +4033,7 @@ function xn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3587
4033
|
} : {
|
|
3588
4034
|
position: "fixed",
|
|
3589
4035
|
zIndex: 2147482e3,
|
|
3590
|
-
...
|
|
4036
|
+
...ir[E](C)
|
|
3591
4037
|
};
|
|
3592
4038
|
return /* @__PURE__ */ f("button", {
|
|
3593
4039
|
ref: x,
|
|
@@ -3638,7 +4084,7 @@ function xn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3638
4084
|
}), w ? /* @__PURE__ */ d("span", { children: T }) : null]
|
|
3639
4085
|
});
|
|
3640
4086
|
}
|
|
3641
|
-
var
|
|
4087
|
+
var dr = {
|
|
3642
4088
|
facebook: {
|
|
3643
4089
|
label: "Facebook",
|
|
3644
4090
|
color: "#1877f2",
|
|
@@ -3705,8 +4151,8 @@ var Sn = {
|
|
|
3705
4151
|
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"
|
|
3706
4152
|
}
|
|
3707
4153
|
};
|
|
3708
|
-
function
|
|
3709
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
4154
|
+
function fr({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
4155
|
+
let l = Array.isArray(e) ? e.filter((e) => e && dr[e.network]) : [];
|
|
3710
4156
|
if (!l.length) return null;
|
|
3711
4157
|
let u = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(u * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, h = c ? (e) => e.preventDefault() : void 0;
|
|
3712
4158
|
return /* @__PURE__ */ d("div", {
|
|
@@ -3719,7 +4165,7 @@ function Cn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3719
4165
|
...P(o)
|
|
3720
4166
|
},
|
|
3721
4167
|
children: l.map((e, r) => {
|
|
3722
|
-
let i =
|
|
4168
|
+
let i = dr[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
|
|
3723
4169
|
return /* @__PURE__ */ d("a", {
|
|
3724
4170
|
href: e.url || "#",
|
|
3725
4171
|
onClick: h,
|
|
@@ -3753,7 +4199,7 @@ function Cn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3753
4199
|
})
|
|
3754
4200
|
});
|
|
3755
4201
|
}
|
|
3756
|
-
function
|
|
4202
|
+
function pr({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
3757
4203
|
if (!e.length) return null;
|
|
3758
4204
|
let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
|
|
3759
4205
|
width: 32,
|
|
@@ -3831,7 +4277,7 @@ function wn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3831
4277
|
})
|
|
3832
4278
|
});
|
|
3833
4279
|
}
|
|
3834
|
-
var
|
|
4280
|
+
var mr = {
|
|
3835
4281
|
small: {
|
|
3836
4282
|
w: 132,
|
|
3837
4283
|
h: 46,
|
|
@@ -3853,21 +4299,21 @@ var Tn = {
|
|
|
3853
4299
|
title: 12.5,
|
|
3854
4300
|
avatar: 46
|
|
3855
4301
|
}
|
|
3856
|
-
},
|
|
3857
|
-
|
|
3858
|
-
var
|
|
4302
|
+
}, hr = (e) => mr[e] ?? mr.medium;
|
|
4303
|
+
mr.medium.w, mr.medium.h;
|
|
4304
|
+
var gr = (e) => String(e?.group ?? "").trim(), _r = (e) => {
|
|
3859
4305
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
3860
4306
|
return e.forEach((e, r) => {
|
|
3861
|
-
let i =
|
|
4307
|
+
let i = gr(e) || `#${r}`;
|
|
3862
4308
|
n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
|
|
3863
4309
|
}), t.flatMap((e) => n.get(e));
|
|
3864
4310
|
};
|
|
3865
|
-
function
|
|
3866
|
-
let i =
|
|
4311
|
+
function vr(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
|
|
4312
|
+
let i = hr(t), a = n ? i.h : i.w, o = n ? 16 : 20, s = (n ? i.w : i.h) + (n ? 56 : 48), c = Array.isArray(e) ? e.filter((e) => e && e.id) : [], l = new Set(c.map((e) => e.id)), u = /* @__PURE__ */ new Map(), d = [];
|
|
3867
4313
|
for (let e of c) e.parent && l.has(e.parent) && e.parent !== e.id ? (u.has(e.parent) || u.set(e.parent, []), u.get(e.parent).push(e)) : d.push(e);
|
|
3868
|
-
d =
|
|
3869
|
-
for (let [e, t] of u) u.set(e,
|
|
3870
|
-
let f = (e, t) => o + (
|
|
4314
|
+
d = _r(d);
|
|
4315
|
+
for (let [e, t] of u) u.set(e, _r(t));
|
|
4316
|
+
let f = (e, t) => o + (gr(e) !== gr(t) && (gr(e) || gr(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
|
|
3871
4317
|
if (t.has(e.id)) return 0;
|
|
3872
4318
|
t.add(e.id);
|
|
3873
4319
|
let n = u.get(e.id) ?? [], r = n.reduce((e, r, i) => e + m(r, t) + (i ? f(n[i - 1], r) : 0), 0), i = Math.max(a, r);
|
|
@@ -3883,7 +4329,7 @@ function kn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
3883
4329
|
x: m,
|
|
3884
4330
|
y: b
|
|
3885
4331
|
});
|
|
3886
|
-
let x =
|
|
4332
|
+
let x = gr(e);
|
|
3887
4333
|
if (x) {
|
|
3888
4334
|
let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
|
|
3889
4335
|
_.has(t) || _.set(t, {
|
|
@@ -3957,19 +4403,19 @@ function kn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
3957
4403
|
horizontal: n
|
|
3958
4404
|
};
|
|
3959
4405
|
}
|
|
3960
|
-
var
|
|
4406
|
+
var yr = (e, t) => {
|
|
3961
4407
|
let n = String(e ?? "");
|
|
3962
4408
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
3963
|
-
},
|
|
4409
|
+
}, br = (e) => {
|
|
3964
4410
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
3965
4411
|
if (!t) return "#ffffff";
|
|
3966
4412
|
let n = t[1];
|
|
3967
4413
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
3968
4414
|
let r = parseInt(n, 16);
|
|
3969
4415
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
3970
|
-
},
|
|
3971
|
-
function
|
|
3972
|
-
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" :
|
|
4416
|
+
}, xr = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
4417
|
+
function Sr(e, t = {}) {
|
|
4418
|
+
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : ot(e);
|
|
3973
4419
|
return n.map((e) => {
|
|
3974
4420
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
3975
4421
|
return {
|
|
@@ -3984,11 +4430,11 @@ function Nn(e, t = {}) {
|
|
|
3984
4430
|
};
|
|
3985
4431
|
});
|
|
3986
4432
|
}
|
|
3987
|
-
var
|
|
4433
|
+
var Cr = {
|
|
3988
4434
|
size: 36,
|
|
3989
4435
|
pad: 10
|
|
3990
4436
|
};
|
|
3991
|
-
function
|
|
4437
|
+
function wr({ node: e, onClose: t }) {
|
|
3992
4438
|
return a(() => {
|
|
3993
4439
|
let e = (e) => e.key === "Escape" && t();
|
|
3994
4440
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -4109,8 +4555,8 @@ function Fn({ node: e, onClose: t }) {
|
|
|
4109
4555
|
})
|
|
4110
4556
|
});
|
|
4111
4557
|
}
|
|
4112
|
-
function
|
|
4113
|
-
let C = o(), [w, T] = l(null), { tenant: E, apiUrl: D } = i(
|
|
4558
|
+
function Tr({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, groupField: h, groupTitles: g = "top", groupBg: _ = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
|
|
4559
|
+
let C = o(), [w, T] = l(null), { tenant: E, apiUrl: D } = i(Q), O = i(Qe)?.[t], [k, A] = l(null);
|
|
4114
4560
|
a(() => {
|
|
4115
4561
|
if (!t || O) return;
|
|
4116
4562
|
let e = !0;
|
|
@@ -4126,7 +4572,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4126
4572
|
D,
|
|
4127
4573
|
O
|
|
4128
4574
|
]);
|
|
4129
|
-
let j = t ?
|
|
4575
|
+
let j = t ? Sr(O ?? k ?? [], {
|
|
4130
4576
|
nameField: n,
|
|
4131
4577
|
titleField: r,
|
|
4132
4578
|
photoField: s,
|
|
@@ -4134,7 +4580,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4134
4580
|
cvField: p,
|
|
4135
4581
|
hrefField: m,
|
|
4136
4582
|
groupField: h
|
|
4137
|
-
}) : e, M =
|
|
4583
|
+
}) : e, M = hr(v), { boxes: N, links: F, groups: I, width: L, height: R } = vr(j, {
|
|
4138
4584
|
size: v,
|
|
4139
4585
|
horizontal: y,
|
|
4140
4586
|
groupTitles: g
|
|
@@ -4192,8 +4638,8 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4192
4638
|
fontSize: M.title + 1,
|
|
4193
4639
|
fontWeight: "600",
|
|
4194
4640
|
opacity: "0.55",
|
|
4195
|
-
fill: r ?
|
|
4196
|
-
children:
|
|
4641
|
+
fill: r ? br(e.color || _) : "var(--page-text, #111827)",
|
|
4642
|
+
children: yr(e.title, Math.floor(e.width / 7))
|
|
4197
4643
|
})] }, `group-${t}`);
|
|
4198
4644
|
}),
|
|
4199
4645
|
F.map((e, t) => /* @__PURE__ */ d("path", {
|
|
@@ -4203,7 +4649,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4203
4649
|
strokeWidth: "1.5"
|
|
4204
4650
|
}, t)),
|
|
4205
4651
|
N.map(({ node: e, x: t, y: n }) => {
|
|
4206
|
-
let r = z.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ?
|
|
4652
|
+
let r = z.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? br(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? br(e.color2) : s, l = S && (xr(e) || e.href), p = () => xr(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Cr.pad + M.avatar + 8 : t + M.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((M.w - M.avatar - 26) / 7) : Math.floor(M.w / 7.6), _ = M.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
4207
4653
|
return /* @__PURE__ */ f("g", {
|
|
4208
4654
|
onClick: l ? p : void 0,
|
|
4209
4655
|
style: l ? { cursor: "pointer" } : void 0,
|
|
@@ -4267,13 +4713,13 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4267
4713
|
e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
4268
4714
|
id: `${C}-${e.id}`,
|
|
4269
4715
|
children: /* @__PURE__ */ d("circle", {
|
|
4270
|
-
cx: t +
|
|
4716
|
+
cx: t + Cr.pad + M.avatar / 2,
|
|
4271
4717
|
cy: n + M.h / 2,
|
|
4272
4718
|
r: M.avatar / 2
|
|
4273
4719
|
})
|
|
4274
4720
|
}), /* @__PURE__ */ d("image", {
|
|
4275
4721
|
href: e.photo,
|
|
4276
|
-
x: t +
|
|
4722
|
+
x: t + Cr.pad,
|
|
4277
4723
|
y: n + (M.h - M.avatar) / 2,
|
|
4278
4724
|
width: M.avatar,
|
|
4279
4725
|
height: M.avatar,
|
|
@@ -4287,7 +4733,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4287
4733
|
fontSize: M.title,
|
|
4288
4734
|
fontWeight: "600",
|
|
4289
4735
|
fill: s,
|
|
4290
|
-
children:
|
|
4736
|
+
children: yr(e.title, g + 4)
|
|
4291
4737
|
}), e.name && /* @__PURE__ */ d("text", {
|
|
4292
4738
|
x: m,
|
|
4293
4739
|
y: n + _ + _ / 2 + M.name * .35,
|
|
@@ -4295,7 +4741,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4295
4741
|
fontSize: M.name,
|
|
4296
4742
|
fontWeight: "600",
|
|
4297
4743
|
fill: c,
|
|
4298
|
-
children:
|
|
4744
|
+
children: yr(e.name, g)
|
|
4299
4745
|
})] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
|
|
4300
4746
|
x: m,
|
|
4301
4747
|
y: n + (v[1] ? M.h * .43 : M.h * .57),
|
|
@@ -4303,7 +4749,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4303
4749
|
fontSize: M.name,
|
|
4304
4750
|
fontWeight: "600",
|
|
4305
4751
|
fill: s,
|
|
4306
|
-
children:
|
|
4752
|
+
children: yr(v[0], g)
|
|
4307
4753
|
}), v[1] && /* @__PURE__ */ d("text", {
|
|
4308
4754
|
x: m,
|
|
4309
4755
|
y: n + M.h * .73,
|
|
@@ -4311,19 +4757,19 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4311
4757
|
fontSize: M.title,
|
|
4312
4758
|
opacity: "0.7",
|
|
4313
4759
|
fill: s,
|
|
4314
|
-
children:
|
|
4760
|
+
children: yr(v[1], g + 4)
|
|
4315
4761
|
})] })
|
|
4316
4762
|
]
|
|
4317
4763
|
}, e.id);
|
|
4318
4764
|
})
|
|
4319
4765
|
]
|
|
4320
|
-
}), w && /* @__PURE__ */ d(
|
|
4766
|
+
}), w && /* @__PURE__ */ d(wr, {
|
|
4321
4767
|
node: w,
|
|
4322
4768
|
onClose: () => T(null)
|
|
4323
4769
|
})]
|
|
4324
4770
|
});
|
|
4325
4771
|
}
|
|
4326
|
-
function
|
|
4772
|
+
function Er({ value: e, onCommit: t, style: n, hint: r }) {
|
|
4327
4773
|
let [i, o] = l(!1), s = c(null);
|
|
4328
4774
|
return a(() => {
|
|
4329
4775
|
if (!i || !s.current) return;
|
|
@@ -4353,7 +4799,7 @@ function Ln({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
4353
4799
|
children: e ?? ""
|
|
4354
4800
|
});
|
|
4355
4801
|
}
|
|
4356
|
-
var
|
|
4802
|
+
var Dr = 360, Or = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;\n font-size: 11px;\n line-height: 16px;\n min-width: 20px;\n text-align: center;\n padding: 1px 4px;\n user-select: none;\n color: #e2e8f0;\n background: rgba(148, 163, 184, 0.16);\n}\n.wb-tedit-btn:hover { background: #4f46e5; color: #fff; }\n.wb-tedit-btn[data-hint] { position: relative; }\n.wb-tedit-btn[data-hint]:hover::after {\n content: attr(data-hint);\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 6px;\n border-radius: 5px;\n background: #1e293b;\n border: 1px solid rgba(148, 163, 184, 0.35);\n color: #e2e8f0;\n font-size: 10px;\n line-height: 14px;\n white-space: nowrap;\n pointer-events: none;\n z-index: 6;\n}\n.wb-tedit-grip { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }\n.wb-tedit-grip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-rowgrip { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; }\n.wb-tedit-rowgrip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-cellon { outline: 2px solid rgba(99, 102, 241, 0.75); outline-offset: -2px; }\n.wb-tedit-bar {\n position: absolute;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 4px 5px;\n border-radius: 8px;\n background: #0f172a;\n border: 1px solid rgba(148, 163, 184, 0.35);\n box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);\n white-space: nowrap;\n}\n.wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }\n.wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }\n", kr = (e, t) => e && t ? `cell-${e}-${t}` : "", Ar = (e) => {
|
|
4357
4803
|
if (!e || typeof e != "object") return e ?? "";
|
|
4358
4804
|
let t = String(e.text ?? "");
|
|
4359
4805
|
return typeof e.href == "string" && e.href ? /* @__PURE__ */ d("a", {
|
|
@@ -4364,7 +4810,7 @@ var Rn = 360, zn = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
|
|
|
4364
4810
|
children: t
|
|
4365
4811
|
}) : t;
|
|
4366
4812
|
};
|
|
4367
|
-
function
|
|
4813
|
+
function jr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], colKeys: o = [], heights: s = [], spans: p, linked: m, source: h, limit: g = 10, header: _ = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: A, style: j, nodeRef: M, edit: N }) {
|
|
4368
4814
|
let F = c(null), I = c(null), [L, R] = l(null), [z, B] = l(null), V = (e, t) => () => R({
|
|
4369
4815
|
r: e,
|
|
4370
4816
|
c: t
|
|
@@ -4378,7 +4824,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4378
4824
|
}
|
|
4379
4825
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4380
4826
|
top: r.bottom - n.top + 4,
|
|
4381
|
-
left: Math.max(0, Math.min(r.left - n.left, n.width -
|
|
4827
|
+
left: Math.max(0, Math.min(r.left - n.left, n.width - Dr))
|
|
4382
4828
|
};
|
|
4383
4829
|
(z?.top !== i.top || z?.left !== i.left) && B(i);
|
|
4384
4830
|
}), a(() => {
|
|
@@ -4388,14 +4834,14 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4388
4834
|
};
|
|
4389
4835
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4390
4836
|
}, [N, L]);
|
|
4391
|
-
let { tenant: H, apiUrl: U } = i(
|
|
4837
|
+
let { tenant: H, apiUrl: U } = i(Q), ee = i(Qe), W = ee?.[h], te = C ? $e(ee) : 1, [ne, G] = l(null);
|
|
4392
4838
|
if (a(() => {
|
|
4393
4839
|
if (!h || W) return;
|
|
4394
4840
|
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(te - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${U}/data/${encodeURIComponent(h.slice(4))}` : `${U}/dynamic/${encodeURIComponent(h)}${n}`;
|
|
4395
4841
|
return fetch(r, { headers: H ? { "x-tenant": H } : {} }).then((e) => e.json()).then((t) => {
|
|
4396
4842
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4397
|
-
return e &&
|
|
4398
|
-
}).catch(() => e &&
|
|
4843
|
+
return e && G(n);
|
|
4844
|
+
}).catch(() => e && G([])), () => {
|
|
4399
4845
|
e = !1;
|
|
4400
4846
|
};
|
|
4401
4847
|
}, [
|
|
@@ -4407,13 +4853,13 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4407
4853
|
te,
|
|
4408
4854
|
g
|
|
4409
4855
|
]), !e.length) return null;
|
|
4410
|
-
let
|
|
4856
|
+
let K = Math.max(1, Number(g) || 10), re = h ? C ? W || h.startsWith("api:") ? (W ?? ne ?? []).slice((te - 1) * K, te * K) : (ne ?? []).slice(0, K) : (W ?? ne ?? []).slice(0, K) : null, q = re ? re.map((t) => e.map((e) => ot(it(t?.data, e.field)))) : t, ie = !!h && !(h && !W && ne === null) && q.length === 0, ae = b ? {
|
|
4411
4857
|
y: 6,
|
|
4412
4858
|
x: 10
|
|
4413
4859
|
} : {
|
|
4414
4860
|
y: 10,
|
|
4415
4861
|
x: 14
|
|
4416
|
-
},
|
|
4862
|
+
}, J = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : ae.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : ae.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 = [
|
|
4417
4863
|
"left",
|
|
4418
4864
|
"center",
|
|
4419
4865
|
"right"
|
|
@@ -4425,7 +4871,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4425
4871
|
r.preventDefault(), r.stopPropagation();
|
|
4426
4872
|
let i = F.current, a = i ? i.clientWidth : 0;
|
|
4427
4873
|
if (!a) return;
|
|
4428
|
-
let o =
|
|
4874
|
+
let o = ce ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
|
|
4429
4875
|
let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
|
|
4430
4876
|
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, N.resize(i);
|
|
4431
4877
|
}, u = () => {
|
|
@@ -4433,8 +4879,8 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4433
4879
|
};
|
|
4434
4880
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4435
4881
|
}, ye = /* @__PURE__ */ new Set();
|
|
4436
|
-
p &&
|
|
4437
|
-
let i = p[
|
|
4882
|
+
p && q.forEach((t, n) => e.forEach((e, t) => {
|
|
4883
|
+
let i = p[kr(r[n], o[t])];
|
|
4438
4884
|
if (!i) return;
|
|
4439
4885
|
let a = Math.max(1, Number(i.c) || 1), s = Math.max(1, Number(i.r) || 1);
|
|
4440
4886
|
for (let e = 0; e < s; e++) for (let r = 0; r < a; r++) (e || r) && ye.add(`${n + e},${t + r}`);
|
|
@@ -4448,7 +4894,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4448
4894
|
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
|
|
4449
4895
|
};
|
|
4450
4896
|
window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
|
|
4451
|
-
},
|
|
4897
|
+
}, Y = (e, t, n, r) => r ? null : /* @__PURE__ */ d("span", {
|
|
4452
4898
|
className: "wb-tedit-btn",
|
|
4453
4899
|
role: "button",
|
|
4454
4900
|
"data-hint": t,
|
|
@@ -4457,7 +4903,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4457
4903
|
},
|
|
4458
4904
|
onClick: n,
|
|
4459
4905
|
children: e
|
|
4460
|
-
}, t),
|
|
4906
|
+
}, t), X = L && L.r < q.length && L.c < e.length ? L : null, Z = (e, t) => N?.labels?.[e] ?? t, xe = X ? p?.[kr(r[X.r], o[X.c])] : null, Se = Math.max(1, Number(xe?.c) || 1), Ce = Math.max(1, Number(xe?.r) || 1);
|
|
4461
4907
|
return /* @__PURE__ */ f("div", {
|
|
4462
4908
|
ref: (e) => {
|
|
4463
4909
|
I.current = e, typeof M == "function" && M(e);
|
|
@@ -4468,8 +4914,8 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4468
4914
|
...ge
|
|
4469
4915
|
},
|
|
4470
4916
|
children: [
|
|
4471
|
-
N && /* @__PURE__ */ d("style", { children:
|
|
4472
|
-
N &&
|
|
4917
|
+
N && /* @__PURE__ */ d("style", { children: Or }),
|
|
4918
|
+
N && X && z && /* @__PURE__ */ f("div", {
|
|
4473
4919
|
className: "wb-tedit-bar",
|
|
4474
4920
|
style: {
|
|
4475
4921
|
top: z.top,
|
|
@@ -4479,23 +4925,23 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4479
4925
|
children: [
|
|
4480
4926
|
/* @__PURE__ */ d("span", {
|
|
4481
4927
|
className: "wb-tedit-at",
|
|
4482
|
-
children: `R${
|
|
4928
|
+
children: `R${X.r + 1}·C${X.c + 1}`
|
|
4483
4929
|
}),
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4930
|
+
Y("+↑", Z("rowAbove", "Insert row above"), () => N.addRow(X.r - 1)),
|
|
4931
|
+
Y("+↓", Z("rowBelow", "Insert row below"), () => N.addRow(X.r)),
|
|
4932
|
+
Y("↑", Z("rowUp", "Move row up"), () => N.moveRow(X.r, -1), X.r === 0),
|
|
4933
|
+
Y("↓", Z("rowDown", "Move row down"), () => N.moveRow(X.r, 1), X.r >= q.length - 1),
|
|
4934
|
+
Y("✕ row", Z("rowDelete", "Delete row"), () => N.dropRow(X.r), q.length <= 1),
|
|
4489
4935
|
/* @__PURE__ */ d("span", { className: "wb-tedit-sep" }),
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4936
|
+
Y("+←", Z("colLeft", "Insert column left"), () => N.addColumn(X.c - 1)),
|
|
4937
|
+
Y("+→", Z("colRight", "Insert column right"), () => N.addColumn(X.c)),
|
|
4938
|
+
Y("←", Z("colMoveLeft", "Move column left"), () => N.moveColumn(X.c, -1), X.c === 0),
|
|
4939
|
+
Y("→", Z("colMoveRight", "Move column right"), () => N.moveColumn(X.c, 1), X.c >= e.length - 1),
|
|
4940
|
+
Y("✕ col", Z("colDelete", "Delete column"), () => N.dropColumn(X.c), e.length <= 1),
|
|
4495
4941
|
/* @__PURE__ */ d("span", { className: "wb-tedit-sep" }),
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4942
|
+
Y("↔", Z("mergeRight", "Merge with the cell on the right"), () => N.merge(X.r, X.c, "right"), X.c + Se >= e.length),
|
|
4943
|
+
Y("↕", Z("mergeDown", "Merge with the cell below"), () => N.merge(X.r, X.c, "down"), X.r + Ce >= q.length),
|
|
4944
|
+
Y("⤫", Z("split", "Split this cell"), () => N.split(X.r, X.c), Se === 1 && Ce === 1)
|
|
4499
4945
|
]
|
|
4500
4946
|
}),
|
|
4501
4947
|
/* @__PURE__ */ d("div", {
|
|
@@ -4514,17 +4960,17 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4514
4960
|
borderCollapse: T && _ !== !1 ? "separate" : "collapse",
|
|
4515
4961
|
borderSpacing: 0,
|
|
4516
4962
|
fontSize: 14,
|
|
4517
|
-
...
|
|
4518
|
-
...y ? { border:
|
|
4963
|
+
...ce ? { tableLayout: "fixed" } : null,
|
|
4964
|
+
...y ? { border: oe } : {}
|
|
4519
4965
|
},
|
|
4520
4966
|
children: [
|
|
4521
|
-
|
|
4967
|
+
ce && /* @__PURE__ */ d("colgroup", { children: n.map((e, t) => /* @__PURE__ */ d("col", { style: { width: `${e}%` } }, t)) }),
|
|
4522
4968
|
_ === !1 ? null : /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e.map((t, n) => /* @__PURE__ */ d("th", {
|
|
4523
4969
|
className: N ? "wb-tedit-head" : void 0,
|
|
4524
4970
|
style: {
|
|
4525
4971
|
textAlign: de(n),
|
|
4526
4972
|
fontWeight: 600,
|
|
4527
|
-
padding:
|
|
4973
|
+
padding: J,
|
|
4528
4974
|
...typeof D == "string" && D ? { color: D } : null,
|
|
4529
4975
|
background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
|
|
4530
4976
|
...T ? {
|
|
@@ -4532,29 +4978,29 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4532
4978
|
top: 0,
|
|
4533
4979
|
zIndex: 2
|
|
4534
4980
|
} : N ? { position: "relative" } : null,
|
|
4535
|
-
...
|
|
4981
|
+
...se
|
|
4536
4982
|
},
|
|
4537
|
-
children: N ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(
|
|
4983
|
+
children: N ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(Er, {
|
|
4538
4984
|
value: t.label ?? t,
|
|
4539
4985
|
onCommit: (e) => N.header(n, e),
|
|
4540
|
-
hint:
|
|
4986
|
+
hint: Z("editCell", "Double-click to edit"),
|
|
4541
4987
|
style: { paddingRight: 6 }
|
|
4542
4988
|
}), n < e.length - 1 && /* @__PURE__ */ d("span", {
|
|
4543
4989
|
className: "wb-tedit-grip",
|
|
4544
|
-
title:
|
|
4990
|
+
title: Z("colWidth", "Drag to resize the column"),
|
|
4545
4991
|
onPointerDown: ve(n)
|
|
4546
4992
|
})] }) : t.label ?? t
|
|
4547
4993
|
}, n)) }) }),
|
|
4548
|
-
/* @__PURE__ */ f("tbody", { children: [
|
|
4994
|
+
/* @__PURE__ */ f("tbody", { children: [ie && /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
|
|
4549
4995
|
colSpan: e.length,
|
|
4550
4996
|
style: {
|
|
4551
|
-
padding:
|
|
4997
|
+
padding: J,
|
|
4552
4998
|
textAlign: "center",
|
|
4553
4999
|
opacity: .6,
|
|
4554
|
-
...
|
|
5000
|
+
...se
|
|
4555
5001
|
},
|
|
4556
5002
|
children: w || "No data yet"
|
|
4557
|
-
}) }),
|
|
5003
|
+
}) }), q.map((t, n) => /* @__PURE__ */ d("tr", {
|
|
4558
5004
|
className: N ? "wb-tedit-row" : void 0,
|
|
4559
5005
|
style: {
|
|
4560
5006
|
...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
|
|
@@ -4562,7 +5008,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4562
5008
|
},
|
|
4563
5009
|
children: e.map((e, i) => {
|
|
4564
5010
|
if (ye.has(`${n},${i}`)) return null;
|
|
4565
|
-
let a =
|
|
5011
|
+
let a = kr(r[n], o[i]), s = m?.[a], c = p?.[a], l = Math.max(1, Number(c?.c) || 1), u = Math.max(1, Number(c?.r) || 1);
|
|
4566
5012
|
return /* @__PURE__ */ f("td", {
|
|
4567
5013
|
className: N ? `wb-tedit-cell${L?.r === n && L?.c === i ? " wb-tedit-cellon" : ""}` : void 0,
|
|
4568
5014
|
onMouseDownCapture: _e ? V(n, i) : void 0,
|
|
@@ -4570,14 +5016,14 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4570
5016
|
colSpan: l > 1 ? l : void 0,
|
|
4571
5017
|
rowSpan: u > 1 ? u : void 0,
|
|
4572
5018
|
style: {
|
|
4573
|
-
padding:
|
|
5019
|
+
padding: J,
|
|
4574
5020
|
...ue(i) ? { textAlign: ue(i) } : null,
|
|
4575
5021
|
...N ? { position: "relative" } : null,
|
|
4576
|
-
...
|
|
5022
|
+
...se
|
|
4577
5023
|
},
|
|
4578
|
-
children: [s ??
|
|
5024
|
+
children: [s ?? Ar(t?.[i]), N && _e && /* @__PURE__ */ d("span", {
|
|
4579
5025
|
className: "wb-tedit-rowgrip",
|
|
4580
|
-
title:
|
|
5026
|
+
title: Z("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
4581
5027
|
onPointerDown: be(n),
|
|
4582
5028
|
onDoubleClick: () => N.resizeRow(n, 0)
|
|
4583
5029
|
})]
|
|
@@ -4590,7 +5036,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4590
5036
|
]
|
|
4591
5037
|
});
|
|
4592
5038
|
}
|
|
4593
|
-
var
|
|
5039
|
+
var Mr = {
|
|
4594
5040
|
small: {
|
|
4595
5041
|
cell: 62,
|
|
4596
5042
|
font: 10.5,
|
|
@@ -4615,9 +5061,9 @@ var Un = {
|
|
|
4615
5061
|
pad: 8,
|
|
4616
5062
|
gap: 4
|
|
4617
5063
|
}
|
|
4618
|
-
},
|
|
4619
|
-
function
|
|
4620
|
-
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" :
|
|
5064
|
+
}, Nr = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Pr = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Fr = 366;
|
|
5065
|
+
function Ir(e, t = {}) {
|
|
5066
|
+
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : ot(e), a = (e) => {
|
|
4621
5067
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
4622
5068
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
4623
5069
|
};
|
|
@@ -4633,7 +5079,7 @@ function qn(e, t = {}) {
|
|
|
4633
5079
|
} : null;
|
|
4634
5080
|
}).filter(Boolean);
|
|
4635
5081
|
}
|
|
4636
|
-
function
|
|
5082
|
+
function Lr(e) {
|
|
4637
5083
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
4638
5084
|
let n = e?.start ? new Date(e.start) : null;
|
|
4639
5085
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -4648,20 +5094,20 @@ function Jn(e) {
|
|
|
4648
5094
|
};
|
|
4649
5095
|
}).filter(Boolean);
|
|
4650
5096
|
}
|
|
4651
|
-
function
|
|
5097
|
+
function Rr(e) {
|
|
4652
5098
|
let t = /* @__PURE__ */ new Map();
|
|
4653
5099
|
for (let n of e) {
|
|
4654
|
-
let e =
|
|
5100
|
+
let e = Pr(n.start), r = n.end ? Pr(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Fr);
|
|
4655
5101
|
for (let r = 0; r <= i; r += 1) {
|
|
4656
|
-
let i =
|
|
5102
|
+
let i = Nr(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
4657
5103
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
4658
5104
|
}
|
|
4659
5105
|
}
|
|
4660
5106
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
4661
5107
|
return t;
|
|
4662
5108
|
}
|
|
4663
|
-
function
|
|
4664
|
-
let { tenant: T, apiUrl: E, locale: D } = i(
|
|
5109
|
+
function zr({ events: e = [], source: t = "", titleField: n = "", startField: r = "", endField: o = "", hrefField: s = "", colorField: c = "", variant: p = "month", size: m = "medium", accent: h = "", eventBg: g = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
|
|
5110
|
+
let { tenant: T, apiUrl: E, locale: D } = i(Q), O = i(Qe)?.[t], [k, A] = l(null), [j, M] = l(() => {
|
|
4665
5111
|
let e = /* @__PURE__ */ new Date();
|
|
4666
5112
|
return {
|
|
4667
5113
|
year: e.getFullYear(),
|
|
@@ -4683,13 +5129,13 @@ function Xn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4683
5129
|
E,
|
|
4684
5130
|
O
|
|
4685
5131
|
]);
|
|
4686
|
-
let N =
|
|
5132
|
+
let N = Mr[m] ?? Mr.medium, F = h || "var(--page-accent, #4f46e5)", I = v || "var(--page-border, rgba(148, 163, 184, 0.35))", L = g || F, R = _ || "var(--page-accent-text, #ffffff)", z = t ? Ir(O ?? k ?? [], {
|
|
4687
5133
|
titleField: n,
|
|
4688
5134
|
startField: r,
|
|
4689
5135
|
endField: o,
|
|
4690
5136
|
hrefField: s,
|
|
4691
5137
|
colorField: c
|
|
4692
|
-
}) :
|
|
5138
|
+
}) : Lr(e), B = Rr(z), V = D || void 0, H = (e, t) => {
|
|
4693
5139
|
let n = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", { style: {
|
|
4694
5140
|
width: 6,
|
|
4695
5141
|
height: 6,
|
|
@@ -4821,10 +5267,10 @@ function Xn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4821
5267
|
})]
|
|
4822
5268
|
});
|
|
4823
5269
|
}
|
|
4824
|
-
let ne = new Date(j.year, j.month, 1),
|
|
4825
|
-
for (let e = 0; e <
|
|
4826
|
-
let t = e -
|
|
4827
|
-
|
|
5270
|
+
let ne = new Date(j.year, j.month, 1), G = y === "sunday" ? 0 : 1, K = (ne.getDay() - G + 7) % 7, re = new Date(j.year, j.month + 1, 0).getDate(), q = Math.ceil((K + re) / 7), ie = Nr(/* @__PURE__ */ new Date()), ae = new Intl.DateTimeFormat(V, { weekday: "short" }), J = [];
|
|
5271
|
+
for (let e = 0; e < q * 7; e += 1) {
|
|
5272
|
+
let t = e - K + 1, n = t >= 1 && t <= re, r = Nr(new Date(j.year, j.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ie;
|
|
5273
|
+
J.push(/* @__PURE__ */ f("div", {
|
|
4828
5274
|
style: {
|
|
4829
5275
|
minHeight: N.cell,
|
|
4830
5276
|
borderTop: `1px solid ${I}`,
|
|
@@ -4881,31 +5327,31 @@ function Xn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4881
5327
|
textAlign: "center",
|
|
4882
5328
|
padding: `0 0 ${N.pad}px`
|
|
4883
5329
|
},
|
|
4884
|
-
children:
|
|
4885
|
-
}, `head-${t}`)),
|
|
5330
|
+
children: ae.format(new Date(2024, 0, 7 + G + t))
|
|
5331
|
+
}, `head-${t}`)), J]
|
|
4886
5332
|
}),
|
|
4887
5333
|
/* @__PURE__ */ d("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4888
5334
|
]
|
|
4889
5335
|
});
|
|
4890
5336
|
}
|
|
4891
|
-
var
|
|
5337
|
+
var Br = {
|
|
4892
5338
|
small: 36,
|
|
4893
5339
|
medium: 56,
|
|
4894
5340
|
large: 88
|
|
4895
5341
|
};
|
|
4896
|
-
function
|
|
4897
|
-
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" :
|
|
5342
|
+
function Vr(e, t = {}) {
|
|
5343
|
+
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : ot(e);
|
|
4898
5344
|
return n.map((e) => {
|
|
4899
|
-
let n = e.data ?? e, i =
|
|
5345
|
+
let n = e.data ?? e, i = it(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(it(n, t.nameField)) : r(n.name);
|
|
4900
5346
|
return {
|
|
4901
5347
|
src: typeof o == "string" ? o.trim() : "",
|
|
4902
5348
|
alt: s,
|
|
4903
|
-
href: t.hrefField ? r(
|
|
5349
|
+
href: t.hrefField ? r(it(n, t.hrefField)) : ""
|
|
4904
5350
|
};
|
|
4905
5351
|
}).filter((e) => e.src);
|
|
4906
5352
|
}
|
|
4907
|
-
function
|
|
4908
|
-
let { tenant: D, apiUrl: O } = i(
|
|
5353
|
+
function Hr({ logos: e = [], source: t = "", imageField: n = "", nameField: r = "", hrefField: o = "", variant: s = "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 }) {
|
|
5354
|
+
let { tenant: D, apiUrl: O } = i(Q), k = i(Qe)?.[t], [A, j] = l(null), M = c(null), N = c(null), [F, I] = l(0), [L, R] = l(0), [z, B] = l(0), [V, H] = l(!0), [U, ee] = l(!1), [W, te] = l(!1);
|
|
4909
5355
|
a(() => {
|
|
4910
5356
|
if (!t || k) return;
|
|
4911
5357
|
let e = !0;
|
|
@@ -4935,7 +5381,7 @@ function $n({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
4935
5381
|
let e = M.current;
|
|
4936
5382
|
if (!e) return;
|
|
4937
5383
|
let t = !0, n = () => {
|
|
4938
|
-
let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight *
|
|
5384
|
+
let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight * K);
|
|
4939
5385
|
t && n.length && R(Math.ceil(Math.max(...n)));
|
|
4940
5386
|
};
|
|
4941
5387
|
n();
|
|
@@ -4944,12 +5390,12 @@ function $n({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
4944
5390
|
t = !1, r.forEach((e) => e.removeEventListener("load", n));
|
|
4945
5391
|
};
|
|
4946
5392
|
});
|
|
4947
|
-
let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [],
|
|
5393
|
+
let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], G = t ? Vr(k ?? A ?? [], {
|
|
4948
5394
|
imageField: n,
|
|
4949
5395
|
nameField: r,
|
|
4950
5396
|
hrefField: o
|
|
4951
|
-
}) : ne,
|
|
4952
|
-
if (!
|
|
5397
|
+
}) : ne, K = Br[p] ?? Br.medium, re = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, q = s === "marquee" ? "step" : s, ie = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), ae = Math.min(3e3, Math.max(100, Number(_) || 500)), J = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), se = (L || K * 3) + re, ce = F ? Math.max(1, Math.floor(F / se)) : J, le = Math.min(J, ce), ue = F ? Math.min(se, F / le) : se;
|
|
5398
|
+
if (!G.length) return /* @__PURE__ */ d("div", {
|
|
4953
5399
|
ref: T,
|
|
4954
5400
|
style: {
|
|
4955
5401
|
width: "100%",
|
|
@@ -4961,7 +5407,7 @@ function $n({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
4961
5407
|
alignItems: "center",
|
|
4962
5408
|
justifyContent: "center",
|
|
4963
5409
|
flexWrap: "wrap",
|
|
4964
|
-
gap:
|
|
5410
|
+
gap: re
|
|
4965
5411
|
},
|
|
4966
5412
|
children: [
|
|
4967
5413
|
0,
|
|
@@ -4971,16 +5417,16 @@ function $n({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
4971
5417
|
4
|
|
4972
5418
|
].map((e) => /* @__PURE__ */ d("div", {
|
|
4973
5419
|
style: {
|
|
4974
|
-
height:
|
|
4975
|
-
width:
|
|
5420
|
+
height: K,
|
|
5421
|
+
width: K * 3,
|
|
4976
5422
|
border: "1px dashed var(--page-border, rgba(148, 163, 184, 0.5))",
|
|
4977
5423
|
borderRadius: 6,
|
|
4978
5424
|
display: "flex",
|
|
4979
5425
|
alignItems: "center",
|
|
4980
5426
|
justifyContent: "center",
|
|
4981
|
-
fontSize: Math.max(10, Math.round(
|
|
5427
|
+
fontSize: Math.max(10, Math.round(K / 4)),
|
|
4982
5428
|
opacity: .45,
|
|
4983
|
-
...
|
|
5429
|
+
...oe
|
|
4984
5430
|
},
|
|
4985
5431
|
children: "LOGO"
|
|
4986
5432
|
}, e))
|
|
@@ -4994,12 +5440,12 @@ function $n({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
4994
5440
|
children: C
|
|
4995
5441
|
}) : null
|
|
4996
5442
|
});
|
|
4997
|
-
let de =
|
|
5443
|
+
let de = G.length, fe = q === "step" && de > le, pe = q === "slider", me = fe && !E && !U && !W, he = v === "right", ge = he ? de : 0, _e = fe ? [...G, ...G] : G, ve = fe ? z * ue : 0, ye = (e, t, n) => {
|
|
4998
5444
|
let r = /* @__PURE__ */ d("img", {
|
|
4999
5445
|
src: e.src,
|
|
5000
5446
|
alt: e.alt ?? "",
|
|
5001
5447
|
style: {
|
|
5002
|
-
height:
|
|
5448
|
+
height: K,
|
|
5003
5449
|
width: "auto",
|
|
5004
5450
|
maxWidth: "100%",
|
|
5005
5451
|
objectFit: "contain",
|
|
@@ -5008,7 +5454,7 @@ function $n({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5008
5454
|
}), i = fe ? {
|
|
5009
5455
|
width: ue,
|
|
5010
5456
|
flex: "0 0 auto",
|
|
5011
|
-
padding: `0 ${
|
|
5457
|
+
padding: `0 ${re / 2}px`,
|
|
5012
5458
|
justifyContent: "center"
|
|
5013
5459
|
} : {};
|
|
5014
5460
|
return e.href && !E ? /* @__PURE__ */ d("a", {
|
|
@@ -5040,20 +5486,20 @@ function $n({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5040
5486
|
...fe ? {
|
|
5041
5487
|
width: _e.length * ue,
|
|
5042
5488
|
transform: `translateX(-${ve}px)`,
|
|
5043
|
-
transition: V ? `transform ${
|
|
5489
|
+
transition: V ? `transform ${ae}ms ease` : "none"
|
|
5044
5490
|
} : pe ? {
|
|
5045
|
-
gap:
|
|
5491
|
+
gap: re,
|
|
5046
5492
|
overflowX: "auto",
|
|
5047
5493
|
scrollBehavior: "smooth",
|
|
5048
5494
|
scrollSnapType: "x proximity"
|
|
5049
5495
|
} : {
|
|
5050
|
-
gap:
|
|
5496
|
+
gap: re,
|
|
5051
5497
|
flexWrap: "wrap",
|
|
5052
5498
|
justifyContent: "center"
|
|
5053
5499
|
}
|
|
5054
5500
|
},
|
|
5055
5501
|
children: _e.map((e, t) => ye(e, t, fe && t >= de))
|
|
5056
|
-
}),
|
|
5502
|
+
}), Y = (e) => {
|
|
5057
5503
|
if (pe) {
|
|
5058
5504
|
let t = M.current;
|
|
5059
5505
|
t && t.scrollBy({
|
|
@@ -5071,10 +5517,10 @@ function $n({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5071
5517
|
H(!1), B(n), requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
5072
5518
|
H(!0), B(n + e);
|
|
5073
5519
|
}));
|
|
5074
|
-
}, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", Z = X !== "off" && (pe ? F > 0 : fe),
|
|
5520
|
+
}, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", Z = X !== "off" && (pe ? F > 0 : fe), xe = (e) => /* @__PURE__ */ d("button", {
|
|
5075
5521
|
type: "button",
|
|
5076
5522
|
"aria-label": e < 0 ? "Previous logos" : "Next logos",
|
|
5077
|
-
onClick: () =>
|
|
5523
|
+
onClick: () => Y(e),
|
|
5078
5524
|
className: `wb-logos-arrow${X === "hover" ? " wb-logos-arrow-shy" : ""}`,
|
|
5079
5525
|
style: { [e < 0 ? "left" : "right"]: 0 },
|
|
5080
5526
|
children: e < 0 ? "‹" : "›"
|
|
@@ -5121,22 +5567,22 @@ function $n({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5121
5567
|
margin: "0 auto"
|
|
5122
5568
|
},
|
|
5123
5569
|
children: [
|
|
5124
|
-
Z ?
|
|
5570
|
+
Z ? xe(-1) : null,
|
|
5125
5571
|
/* @__PURE__ */ d("div", {
|
|
5126
5572
|
style: { overflow: "hidden" },
|
|
5127
5573
|
children: be
|
|
5128
5574
|
}),
|
|
5129
|
-
Z ?
|
|
5575
|
+
Z ? xe(1) : null
|
|
5130
5576
|
]
|
|
5131
5577
|
}) : /* @__PURE__ */ f(u, { children: [
|
|
5132
|
-
Z ?
|
|
5578
|
+
Z ? xe(-1) : null,
|
|
5133
5579
|
be,
|
|
5134
|
-
Z ?
|
|
5580
|
+
Z ? xe(1) : null
|
|
5135
5581
|
] }),
|
|
5136
|
-
/* @__PURE__ */ d(
|
|
5582
|
+
/* @__PURE__ */ d(Ur, {
|
|
5137
5583
|
running: me,
|
|
5138
|
-
every:
|
|
5139
|
-
slide:
|
|
5584
|
+
every: ie + ae,
|
|
5585
|
+
slide: ae,
|
|
5140
5586
|
step: he ? -1 : 1,
|
|
5141
5587
|
index: z,
|
|
5142
5588
|
total: de,
|
|
@@ -5147,7 +5593,7 @@ function $n({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5147
5593
|
]
|
|
5148
5594
|
});
|
|
5149
5595
|
}
|
|
5150
|
-
function
|
|
5596
|
+
function Ur({ running: e, every: t, slide: n, step: r, index: i, total: o, home: s, setIndex: c, setAnimate: l }) {
|
|
5151
5597
|
a(() => {
|
|
5152
5598
|
if (!e) return;
|
|
5153
5599
|
let n = setInterval(() => {
|
|
@@ -5183,13 +5629,13 @@ function er({ running: e, every: t, slide: n, step: r, index: i, total: o, home:
|
|
|
5183
5629
|
l
|
|
5184
5630
|
]), null;
|
|
5185
5631
|
}
|
|
5186
|
-
var
|
|
5632
|
+
var Wr = {
|
|
5187
5633
|
small: 380,
|
|
5188
5634
|
medium: 560,
|
|
5189
5635
|
large: 820,
|
|
5190
5636
|
full: "100%"
|
|
5191
5637
|
};
|
|
5192
|
-
function
|
|
5638
|
+
function Gr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: i = 0, size: o = "medium", title: s = "", showClose: u = !0, backdropClose: p = !0, position: m = "center", actions: h = [], showCloseAction: g = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
|
|
5193
5639
|
let [C, w] = l(!1), T = c(null);
|
|
5194
5640
|
a(() => {
|
|
5195
5641
|
if (S || !e) return;
|
|
@@ -5214,7 +5660,7 @@ function nr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5214
5660
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
5215
5661
|
};
|
|
5216
5662
|
}, [S, C]);
|
|
5217
|
-
let E =
|
|
5663
|
+
let E = Wr[o] ?? Wr.medium, D = (e) => {
|
|
5218
5664
|
let t = {
|
|
5219
5665
|
padding: "9px 16px",
|
|
5220
5666
|
borderRadius: 6,
|
|
@@ -5383,7 +5829,7 @@ function nr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5383
5829
|
})]
|
|
5384
5830
|
});
|
|
5385
5831
|
}
|
|
5386
|
-
function
|
|
5832
|
+
function Kr({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: i = "left", panelWidth: o = "", offset: s = 8, editorOpen: u = !0, linked: p, style: m, nodeRef: h, inert: g = !1 }) {
|
|
5387
5833
|
let [_, v] = l(!1), y = c(null), b = c(null), x = r !== "click", S = () => {
|
|
5388
5834
|
b.current && clearTimeout(b.current), b.current = null;
|
|
5389
5835
|
}, C = () => {
|
|
@@ -5484,99 +5930,101 @@ function rr({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu
|
|
|
5484
5930
|
}), E]
|
|
5485
5931
|
});
|
|
5486
5932
|
}
|
|
5487
|
-
var
|
|
5488
|
-
PageRoot:
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5933
|
+
var qr = {
|
|
5934
|
+
PageRoot: _t,
|
|
5935
|
+
MarkdownBlock: Mt,
|
|
5936
|
+
CalendarBlock: zr,
|
|
5937
|
+
LogoCarousel: Hr,
|
|
5938
|
+
DialogBlock: Gr,
|
|
5939
|
+
DropdownBlock: Kr,
|
|
5940
|
+
Section: vt,
|
|
5941
|
+
Container: yt,
|
|
5942
|
+
Heading: bt,
|
|
5943
|
+
TextBlock: It,
|
|
5944
|
+
ButtonBlock: zt,
|
|
5945
|
+
ImageBlock: Bt,
|
|
5946
|
+
Spacer: Jt,
|
|
5947
|
+
Divider: Yt,
|
|
5948
|
+
BoxBlock: Xt,
|
|
5949
|
+
SliderBlock: nn,
|
|
5950
|
+
CanvasSlider: rn,
|
|
5951
|
+
TabsBlock: bn,
|
|
5952
|
+
QuickStack: Kn,
|
|
5953
|
+
CollectionList: qn,
|
|
5954
|
+
CollectionSearch: Jn,
|
|
5955
|
+
BreadcrumbsBlock: Yn,
|
|
5956
|
+
PaginationBlock: Xn,
|
|
5957
|
+
StepperBlock: pr,
|
|
5958
|
+
SocialLinksBlock: fr,
|
|
5959
|
+
ThemeModeBlock: tr,
|
|
5960
|
+
ScrollTopBlock: ur,
|
|
5961
|
+
CounterBlock: lr,
|
|
5962
|
+
OrgChartBlock: Tr,
|
|
5963
|
+
TableBlock: jr,
|
|
5964
|
+
IconBlock: pn,
|
|
5965
|
+
MapBlock: dn,
|
|
5966
|
+
MasonryBlock: hn,
|
|
5967
|
+
AccordionBlock: xn,
|
|
5968
|
+
NavbarBlock: yn,
|
|
5969
|
+
ListBlock: Ft,
|
|
5970
|
+
TextSpan: Tt,
|
|
5971
|
+
QuoteBlock: Pt,
|
|
5972
|
+
TextLink: Rt,
|
|
5973
|
+
RichTextBlock: jt,
|
|
5974
|
+
RichContentBlock: jt,
|
|
5975
|
+
VideoBlock: Vt,
|
|
5976
|
+
YouTubeBlock: Ut,
|
|
5977
|
+
IframeBlock: Wt,
|
|
5978
|
+
EmbedBlock: qt,
|
|
5979
|
+
FormBlock: Pn,
|
|
5980
|
+
FormLabel: zn,
|
|
5981
|
+
FormInput: Bn,
|
|
5982
|
+
FormTextarea: Vn,
|
|
5983
|
+
FormCheckbox: (e) => /* @__PURE__ */ d(Hn, {
|
|
5536
5984
|
kind: "checkbox",
|
|
5537
5985
|
...e
|
|
5538
5986
|
}),
|
|
5539
|
-
FormRadio: (e) => /* @__PURE__ */ d(
|
|
5987
|
+
FormRadio: (e) => /* @__PURE__ */ d(Hn, {
|
|
5540
5988
|
kind: "radio",
|
|
5541
5989
|
...e
|
|
5542
5990
|
}),
|
|
5543
|
-
FormSelect:
|
|
5544
|
-
FormFile:
|
|
5545
|
-
FormRecaptcha:
|
|
5546
|
-
FormSubmit:
|
|
5547
|
-
},
|
|
5991
|
+
FormSelect: Un,
|
|
5992
|
+
FormFile: Wn,
|
|
5993
|
+
FormRecaptcha: Rn,
|
|
5994
|
+
FormSubmit: Gn
|
|
5995
|
+
}, Jr = {
|
|
5548
5996
|
id: "auth",
|
|
5549
5997
|
label: "Accounts",
|
|
5550
5998
|
category: "Apps",
|
|
5551
5999
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
5552
6000
|
ssr: "shell",
|
|
5553
6001
|
settings: ["site.authRedirect"]
|
|
5554
|
-
},
|
|
6002
|
+
}, Yr = n({
|
|
5555
6003
|
user: null,
|
|
5556
6004
|
status: "idle",
|
|
5557
6005
|
ensure: () => {},
|
|
5558
6006
|
refresh: () => {},
|
|
5559
6007
|
signOut: () => {}
|
|
5560
6008
|
});
|
|
5561
|
-
function
|
|
6009
|
+
function Xr(e, t) {
|
|
5562
6010
|
return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
|
|
5563
6011
|
}
|
|
5564
|
-
function
|
|
6012
|
+
function Zr(e) {
|
|
5565
6013
|
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);
|
|
5566
6014
|
return {
|
|
5567
6015
|
mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
|
|
5568
6016
|
url: i,
|
|
5569
6017
|
mePath: a,
|
|
5570
6018
|
logoutPath: o,
|
|
5571
|
-
meUrl:
|
|
5572
|
-
logoutUrl:
|
|
6019
|
+
meUrl: Xr(i, a),
|
|
6020
|
+
logoutUrl: Xr(i, o),
|
|
5573
6021
|
loginPage: r(n.loginPage),
|
|
5574
6022
|
userPath: r(n.userPath),
|
|
5575
6023
|
auth: n.auth === "bearer" ? "bearer" : "cookies",
|
|
5576
6024
|
tokenKey: r(n.tokenKey) || "webim_session_token"
|
|
5577
6025
|
};
|
|
5578
6026
|
}
|
|
5579
|
-
function
|
|
6027
|
+
function Qr(e, t) {
|
|
5580
6028
|
if (!t) return e ?? null;
|
|
5581
6029
|
let n = e;
|
|
5582
6030
|
for (let e of t.split(".")) {
|
|
@@ -5585,26 +6033,26 @@ function lr(e, t) {
|
|
|
5585
6033
|
}
|
|
5586
6034
|
return n ?? null;
|
|
5587
6035
|
}
|
|
5588
|
-
function
|
|
6036
|
+
function $r(e) {
|
|
5589
6037
|
try {
|
|
5590
6038
|
return window.localStorage.getItem(e) || "";
|
|
5591
6039
|
} catch {
|
|
5592
6040
|
return "";
|
|
5593
6041
|
}
|
|
5594
6042
|
}
|
|
5595
|
-
function
|
|
6043
|
+
function ei(e) {
|
|
5596
6044
|
try {
|
|
5597
6045
|
window.localStorage.removeItem(e);
|
|
5598
6046
|
} catch {}
|
|
5599
6047
|
}
|
|
5600
|
-
var
|
|
5601
|
-
let e = i(
|
|
6048
|
+
var ti = () => {
|
|
6049
|
+
let e = i(Yr);
|
|
5602
6050
|
return a(() => {
|
|
5603
6051
|
e.ensure();
|
|
5604
6052
|
}, [e]), e;
|
|
5605
6053
|
};
|
|
5606
|
-
function
|
|
5607
|
-
let f = i(
|
|
6054
|
+
function ni({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u }) {
|
|
6055
|
+
let f = i(Q), p = o || f?.apiUrl || "/api", m = u || f?.tenant || "", h = s(() => Zr(f?.settings), [f?.settings]), [g, _] = l(t ?? null), [v, y] = l(t ? "user" : n ? "guest" : "idle"), b = c(!1), x = r((e, t) => fetch(`${p}${e}`, {
|
|
5608
6056
|
...t,
|
|
5609
6057
|
credentials: "include",
|
|
5610
6058
|
headers: {
|
|
@@ -5616,9 +6064,9 @@ function pr({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
|
|
|
5616
6064
|
if (n) return Promise.resolve(null);
|
|
5617
6065
|
if (h.mode === "off") return Promise.resolve(S(null));
|
|
5618
6066
|
if (h.mode === "custom") {
|
|
5619
|
-
let e = h.auth === "bearer" ?
|
|
6067
|
+
let e = h.auth === "bearer" ? $r(h.tokenKey) : "";
|
|
5620
6068
|
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) => {
|
|
5621
|
-
let t =
|
|
6069
|
+
let t = Qr(e, h.userPath);
|
|
5622
6070
|
return S(t && typeof t == "object" ? t : null);
|
|
5623
6071
|
}).catch(() => S(null));
|
|
5624
6072
|
}
|
|
@@ -5631,12 +6079,12 @@ function pr({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
|
|
|
5631
6079
|
]), w = r(() => {
|
|
5632
6080
|
if (h.mode === "off") return S(null), Promise.resolve();
|
|
5633
6081
|
if (h.mode === "custom") {
|
|
5634
|
-
let e = h.auth === "bearer" ?
|
|
6082
|
+
let e = h.auth === "bearer" ? $r(h.tokenKey) : "";
|
|
5635
6083
|
return (h.logoutUrl ? fetch(h.logoutUrl, {
|
|
5636
6084
|
method: "post",
|
|
5637
6085
|
...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
|
|
5638
6086
|
}).catch(() => {}) : Promise.resolve()).then(() => {
|
|
5639
|
-
h.auth === "bearer" &&
|
|
6087
|
+
h.auth === "bearer" && ei(h.tokenKey), S(null);
|
|
5640
6088
|
});
|
|
5641
6089
|
}
|
|
5642
6090
|
return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
@@ -5686,19 +6134,19 @@ function pr({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
|
|
|
5686
6134
|
h.loginPage,
|
|
5687
6135
|
C,
|
|
5688
6136
|
w
|
|
5689
|
-
]), /* @__PURE__ */ d(
|
|
6137
|
+
]), /* @__PURE__ */ d(Yr.Provider, {
|
|
5690
6138
|
value: E,
|
|
5691
6139
|
children: e
|
|
5692
6140
|
});
|
|
5693
6141
|
}
|
|
5694
|
-
function
|
|
5695
|
-
let { status: n } =
|
|
6142
|
+
function ri({ when: e, children: t }) {
|
|
6143
|
+
let { status: n } = ti();
|
|
5696
6144
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
5697
6145
|
}
|
|
5698
6146
|
//#endregion
|
|
5699
6147
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
5700
|
-
function
|
|
5701
|
-
let { tenant: h, apiUrl: g, settings: _ } = i(
|
|
6148
|
+
function ii({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
|
|
6149
|
+
let { tenant: h, apiUrl: g, settings: _ } = i(Q), [v, y] = l("form"), [b, x] = l(""), [S, C] = l(!1), w = e === "register", T = u ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
|
|
5702
6150
|
if (e.preventDefault(), u) return;
|
|
5703
6151
|
let n = new FormData(e.currentTarget);
|
|
5704
6152
|
C(!0), x("");
|
|
@@ -5746,20 +6194,20 @@ function hr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5746
6194
|
children: [
|
|
5747
6195
|
w ? /* @__PURE__ */ f("label", {
|
|
5748
6196
|
style: {
|
|
5749
|
-
...
|
|
6197
|
+
...Cn,
|
|
5750
6198
|
display: "grid",
|
|
5751
6199
|
gap: 6
|
|
5752
6200
|
},
|
|
5753
6201
|
children: [a, /* @__PURE__ */ d("input", {
|
|
5754
6202
|
name: "name",
|
|
5755
6203
|
type: "text",
|
|
5756
|
-
style:
|
|
5757
|
-
...
|
|
6204
|
+
style: wn,
|
|
6205
|
+
...En(u)
|
|
5758
6206
|
})]
|
|
5759
6207
|
}) : null,
|
|
5760
6208
|
/* @__PURE__ */ f("label", {
|
|
5761
6209
|
style: {
|
|
5762
|
-
...
|
|
6210
|
+
...Cn,
|
|
5763
6211
|
display: "grid",
|
|
5764
6212
|
gap: 6
|
|
5765
6213
|
},
|
|
@@ -5767,13 +6215,13 @@ function hr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5767
6215
|
name: "email",
|
|
5768
6216
|
type: "email",
|
|
5769
6217
|
required: !u,
|
|
5770
|
-
style:
|
|
5771
|
-
...
|
|
6218
|
+
style: wn,
|
|
6219
|
+
...En(u)
|
|
5772
6220
|
})]
|
|
5773
6221
|
}),
|
|
5774
6222
|
/* @__PURE__ */ f("label", {
|
|
5775
6223
|
style: {
|
|
5776
|
-
...
|
|
6224
|
+
...Cn,
|
|
5777
6225
|
display: "grid",
|
|
5778
6226
|
gap: 6
|
|
5779
6227
|
},
|
|
@@ -5781,15 +6229,15 @@ function hr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5781
6229
|
name: "password",
|
|
5782
6230
|
type: "password",
|
|
5783
6231
|
required: !u,
|
|
5784
|
-
style:
|
|
5785
|
-
...
|
|
6232
|
+
style: wn,
|
|
6233
|
+
...En(u)
|
|
5786
6234
|
})]
|
|
5787
6235
|
}),
|
|
5788
6236
|
/* @__PURE__ */ d("button", {
|
|
5789
6237
|
type: u ? "button" : "submit",
|
|
5790
6238
|
disabled: S || void 0,
|
|
5791
6239
|
style: {
|
|
5792
|
-
...
|
|
6240
|
+
...ft,
|
|
5793
6241
|
border: 0,
|
|
5794
6242
|
padding: "10px 22px",
|
|
5795
6243
|
borderRadius: 8,
|
|
@@ -5821,8 +6269,8 @@ function hr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5821
6269
|
]
|
|
5822
6270
|
});
|
|
5823
6271
|
}
|
|
5824
|
-
function
|
|
5825
|
-
let { user: c, status: l, signOut: u } =
|
|
6272
|
+
function ai({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
6273
|
+
let { user: c, status: l, signOut: u } = ti(), p = a ? s || "user" : l, m = a ? {
|
|
5826
6274
|
name: "Ada Lovelace",
|
|
5827
6275
|
email: "ada@example.com"
|
|
5828
6276
|
} : c;
|
|
@@ -5843,7 +6291,7 @@ function gr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5843
6291
|
children: [
|
|
5844
6292
|
/* @__PURE__ */ f("span", {
|
|
5845
6293
|
style: {
|
|
5846
|
-
...
|
|
6294
|
+
...Cn,
|
|
5847
6295
|
fontWeight: 600
|
|
5848
6296
|
},
|
|
5849
6297
|
children: [
|
|
@@ -5854,7 +6302,7 @@ function gr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5854
6302
|
}),
|
|
5855
6303
|
n && m?.email ? /* @__PURE__ */ d("span", {
|
|
5856
6304
|
style: {
|
|
5857
|
-
...
|
|
6305
|
+
...Cn,
|
|
5858
6306
|
opacity: .7
|
|
5859
6307
|
},
|
|
5860
6308
|
children: m.email
|
|
@@ -5863,14 +6311,14 @@ function gr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5863
6311
|
type: "button",
|
|
5864
6312
|
onClick: a ? void 0 : u,
|
|
5865
6313
|
style: {
|
|
5866
|
-
...
|
|
6314
|
+
...ft,
|
|
5867
6315
|
border: 0,
|
|
5868
6316
|
padding: "8px 16px",
|
|
5869
6317
|
borderRadius: 8,
|
|
5870
6318
|
fontSize: 14,
|
|
5871
6319
|
cursor: a ? "default" : "pointer"
|
|
5872
6320
|
},
|
|
5873
|
-
...
|
|
6321
|
+
...En(a),
|
|
5874
6322
|
children: t
|
|
5875
6323
|
})
|
|
5876
6324
|
]
|
|
@@ -5887,40 +6335,40 @@ function gr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5887
6335
|
}
|
|
5888
6336
|
//#endregion
|
|
5889
6337
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
5890
|
-
var
|
|
6338
|
+
var oi = {
|
|
5891
6339
|
id: "consent",
|
|
5892
6340
|
label: "Cookie consent",
|
|
5893
6341
|
category: "Apps",
|
|
5894
6342
|
keys: ["CookieConsent"],
|
|
5895
6343
|
ssr: "shell",
|
|
5896
6344
|
settings: []
|
|
5897
|
-
},
|
|
5898
|
-
function
|
|
6345
|
+
}, si = "webim.cookie_consent";
|
|
6346
|
+
function ci() {
|
|
5899
6347
|
try {
|
|
5900
|
-
let e = window.localStorage.getItem(
|
|
6348
|
+
let e = window.localStorage.getItem(si), t = e ? JSON.parse(e) : null;
|
|
5901
6349
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
5902
6350
|
} catch {
|
|
5903
6351
|
return "";
|
|
5904
6352
|
}
|
|
5905
6353
|
}
|
|
5906
|
-
function
|
|
6354
|
+
function li(e) {
|
|
5907
6355
|
try {
|
|
5908
6356
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
5909
6357
|
} catch {}
|
|
5910
6358
|
}
|
|
5911
|
-
function
|
|
6359
|
+
function ui(e) {
|
|
5912
6360
|
try {
|
|
5913
|
-
window.localStorage.setItem(
|
|
6361
|
+
window.localStorage.setItem(si, JSON.stringify({
|
|
5914
6362
|
choice: e,
|
|
5915
6363
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5916
6364
|
}));
|
|
5917
6365
|
} catch {}
|
|
5918
|
-
|
|
6366
|
+
li(e);
|
|
5919
6367
|
try {
|
|
5920
6368
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
5921
6369
|
} catch {}
|
|
5922
6370
|
}
|
|
5923
|
-
var
|
|
6371
|
+
var di = {
|
|
5924
6372
|
bottom: {
|
|
5925
6373
|
left: 0,
|
|
5926
6374
|
right: 0,
|
|
@@ -5942,18 +6390,18 @@ var Sr = {
|
|
|
5942
6390
|
maxWidth: 400
|
|
5943
6391
|
}
|
|
5944
6392
|
};
|
|
5945
|
-
function
|
|
6393
|
+
function fi({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: o, position: s, linked: c, style: p, nodeRef: m, inert: h }) {
|
|
5946
6394
|
let [g, _] = l(!!h), [v, y] = l(null), b = (e) => {
|
|
5947
6395
|
y(e), typeof m == "function" && m(e);
|
|
5948
6396
|
};
|
|
5949
6397
|
if (a(() => {
|
|
5950
6398
|
if (h) return;
|
|
5951
|
-
let e =
|
|
5952
|
-
e ?
|
|
6399
|
+
let e = ci();
|
|
6400
|
+
e ? li(e) : _(!0);
|
|
5953
6401
|
}, [h, v]), !g) return null;
|
|
5954
6402
|
let x = (e) => () => {
|
|
5955
|
-
h || (
|
|
5956
|
-
}, S =
|
|
6403
|
+
h || (ui(e), _(!1));
|
|
6404
|
+
}, S = di[s] ?? di.bottom, C = {
|
|
5957
6405
|
appearance: "none",
|
|
5958
6406
|
font: "inherit",
|
|
5959
6407
|
fontSize: 14,
|
|
@@ -6033,37 +6481,37 @@ function Cr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
6033
6481
|
}
|
|
6034
6482
|
//#endregion
|
|
6035
6483
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
6036
|
-
var
|
|
6484
|
+
var pi = {
|
|
6037
6485
|
id: "language",
|
|
6038
6486
|
label: "Language",
|
|
6039
6487
|
category: "Apps",
|
|
6040
6488
|
keys: ["SiteLanguagePicker"],
|
|
6041
6489
|
ssr: "prefetch",
|
|
6042
6490
|
settings: ["locales"]
|
|
6043
|
-
},
|
|
6491
|
+
}, mi = {
|
|
6044
6492
|
id: "search",
|
|
6045
6493
|
label: "Search",
|
|
6046
6494
|
category: "Apps",
|
|
6047
6495
|
keys: ["SiteSearch"],
|
|
6048
6496
|
ssr: "prefetch",
|
|
6049
6497
|
settings: []
|
|
6050
|
-
},
|
|
6051
|
-
function
|
|
6498
|
+
}, hi = 50, gi = 2e3;
|
|
6499
|
+
function _i() {
|
|
6052
6500
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
6053
6501
|
}
|
|
6054
|
-
function
|
|
6502
|
+
function vi(e, t) {
|
|
6055
6503
|
let n = e?.data ?? {}, r = [];
|
|
6056
6504
|
for (let e of Object.values(n)) {
|
|
6057
|
-
let t = e == null ? "" :
|
|
6058
|
-
if (t && r.push(t), r.join(" ").length >
|
|
6505
|
+
let t = e == null ? "" : ot(e);
|
|
6506
|
+
if (t && r.push(t), r.join(" ").length > gi) break;
|
|
6059
6507
|
}
|
|
6060
|
-
return r.join(" ").slice(0,
|
|
6508
|
+
return r.join(" ").slice(0, gi).toLocaleLowerCase(t || void 0);
|
|
6061
6509
|
}
|
|
6062
|
-
function
|
|
6063
|
-
let { tenant: b, apiUrl: x, locale: S } = i(
|
|
6510
|
+
function yi({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: r = !1, layout: o = "inline", includePages: s = !0, collections: u = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
|
|
6511
|
+
let { tenant: b, apiUrl: x, locale: S } = i(Q), [C, w] = l(() => _i()), [T, E] = l(() => _i()), [D, O] = l(null), [k, A] = l(!1), j = c(null), M = o === "popup";
|
|
6064
6512
|
a(() => {
|
|
6065
6513
|
let e = () => {
|
|
6066
|
-
let e =
|
|
6514
|
+
let e = _i();
|
|
6067
6515
|
w(e), E(e);
|
|
6068
6516
|
};
|
|
6069
6517
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -6114,8 +6562,8 @@ function Ar({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6114
6562
|
});
|
|
6115
6563
|
}
|
|
6116
6564
|
else for (let t of e.rows) {
|
|
6117
|
-
if (!
|
|
6118
|
-
let n = t?.data ?? {}, r =
|
|
6565
|
+
if (!vi(t, S).includes(N)) continue;
|
|
6566
|
+
let n = t?.data ?? {}, r = ot(n.name) || "Untitled", i = ot(n.slug);
|
|
6119
6567
|
F.push({
|
|
6120
6568
|
key: `entry:${t.id}`,
|
|
6121
6569
|
title: r,
|
|
@@ -6123,7 +6571,7 @@ function Ar({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6123
6571
|
kind: "entry"
|
|
6124
6572
|
});
|
|
6125
6573
|
}
|
|
6126
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
6574
|
+
let I = F.slice(0, Math.min(Math.max(1, p), hi)), L = (e) => {
|
|
6127
6575
|
if (v) {
|
|
6128
6576
|
e.preventDefault(), w(T), A(!0);
|
|
6129
6577
|
return;
|
|
@@ -6205,7 +6653,7 @@ function Ar({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6205
6653
|
onChange: (e) => E(e.target.value),
|
|
6206
6654
|
onFocus: () => N && A(!0),
|
|
6207
6655
|
style: {
|
|
6208
|
-
...
|
|
6656
|
+
...wn,
|
|
6209
6657
|
flexGrow: 1,
|
|
6210
6658
|
minWidth: 0
|
|
6211
6659
|
}
|
|
@@ -6263,21 +6711,21 @@ function Ar({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6263
6711
|
}
|
|
6264
6712
|
//#endregion
|
|
6265
6713
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
6266
|
-
function
|
|
6714
|
+
function bi(e) {
|
|
6267
6715
|
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());
|
|
6268
6716
|
return [...new Set(n.map((e) => e.trim()))];
|
|
6269
6717
|
}
|
|
6270
|
-
var
|
|
6271
|
-
function
|
|
6718
|
+
var xi = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
6719
|
+
function Si(e, t) {
|
|
6272
6720
|
let n = String(e ?? "").toUpperCase();
|
|
6273
6721
|
if (t === "code") return n;
|
|
6274
6722
|
let r = "";
|
|
6275
6723
|
try {
|
|
6276
|
-
r =
|
|
6724
|
+
r = xi(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
6277
6725
|
} catch {}
|
|
6278
6726
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
6279
6727
|
}
|
|
6280
|
-
function
|
|
6728
|
+
function Ci(e, t) {
|
|
6281
6729
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
6282
6730
|
if (typeof window > "u") return n || "?";
|
|
6283
6731
|
try {
|
|
@@ -6287,8 +6735,8 @@ function Pr(e, t) {
|
|
|
6287
6735
|
return n || "/";
|
|
6288
6736
|
}
|
|
6289
6737
|
}
|
|
6290
|
-
function
|
|
6291
|
-
let c = i(
|
|
6738
|
+
function wi({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: s }) {
|
|
6739
|
+
let c = i(Q), l = bi(c?.settings), u = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : u, m = {
|
|
6292
6740
|
display: "inline-flex",
|
|
6293
6741
|
alignItems: "center",
|
|
6294
6742
|
gap: 8,
|
|
@@ -6323,7 +6771,7 @@ function Fr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
6323
6771
|
style: { opacity: .4 },
|
|
6324
6772
|
children: n ?? "·"
|
|
6325
6773
|
}), /* @__PURE__ */ d("a", {
|
|
6326
|
-
href:
|
|
6774
|
+
href: Ci(e, e === u),
|
|
6327
6775
|
hrefLang: e,
|
|
6328
6776
|
"aria-current": e === p ? "true" : void 0,
|
|
6329
6777
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -6333,7 +6781,7 @@ function Fr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
6333
6781
|
textDecoration: "none",
|
|
6334
6782
|
cursor: s ? "default" : "pointer"
|
|
6335
6783
|
},
|
|
6336
|
-
children:
|
|
6784
|
+
children: Si(e, t)
|
|
6337
6785
|
})]
|
|
6338
6786
|
}, e))]
|
|
6339
6787
|
}) : /* @__PURE__ */ f("div", {
|
|
@@ -6344,7 +6792,7 @@ function Fr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
6344
6792
|
value: p,
|
|
6345
6793
|
onChange: s ? void 0 : (e) => {
|
|
6346
6794
|
let t = e.target.value;
|
|
6347
|
-
window.location.assign(
|
|
6795
|
+
window.location.assign(Ci(t, t === u));
|
|
6348
6796
|
},
|
|
6349
6797
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
6350
6798
|
style: {
|
|
@@ -6358,47 +6806,47 @@ function Fr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
6358
6806
|
},
|
|
6359
6807
|
children: l.map((e) => /* @__PURE__ */ d("option", {
|
|
6360
6808
|
value: e,
|
|
6361
|
-
children:
|
|
6809
|
+
children: Si(e, t)
|
|
6362
6810
|
}, e))
|
|
6363
6811
|
})]
|
|
6364
6812
|
});
|
|
6365
6813
|
}
|
|
6366
6814
|
//#endregion
|
|
6367
6815
|
//#region ../ui/src/components/builder/apps/index.js
|
|
6368
|
-
var
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
],
|
|
6374
|
-
SiteLoginForm:
|
|
6375
|
-
SiteAccountMenu:
|
|
6376
|
-
SiteLanguagePicker:
|
|
6377
|
-
CookieConsent:
|
|
6378
|
-
SiteSearch:
|
|
6816
|
+
var Ti = [
|
|
6817
|
+
Jr,
|
|
6818
|
+
pi,
|
|
6819
|
+
oi,
|
|
6820
|
+
mi
|
|
6821
|
+
], Ei = {
|
|
6822
|
+
SiteLoginForm: ii,
|
|
6823
|
+
SiteAccountMenu: ai,
|
|
6824
|
+
SiteLanguagePicker: wi,
|
|
6825
|
+
CookieConsent: fi,
|
|
6826
|
+
SiteSearch: yi
|
|
6379
6827
|
};
|
|
6380
|
-
new Set(
|
|
6828
|
+
new Set(Ti.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
6381
6829
|
//#endregion
|
|
6382
6830
|
//#region ../ui/src/components/builder/three/runtime.js
|
|
6383
|
-
var
|
|
6831
|
+
var Di = "0.185.1", Oi = "4.2.0", ki = "https://cdn.jsdelivr.net/npm", Ai = `${ki}/three@${Di}/+esm`, ji = `${ki}/@google/model-viewer@${Oi}/dist/model-viewer.min.js`, Mi = (e) => import(
|
|
6384
6832
|
/* @vite-ignore */
|
|
6385
6833
|
/* webpackIgnore: true */
|
|
6386
6834
|
e
|
|
6387
|
-
),
|
|
6388
|
-
function
|
|
6389
|
-
if (
|
|
6835
|
+
), Ni = /* @__PURE__ */ new Map();
|
|
6836
|
+
function Pi(e) {
|
|
6837
|
+
if (Ni.has(e)) return Ni.get(e);
|
|
6390
6838
|
if (typeof window > "u") return new Promise(() => {});
|
|
6391
|
-
let t =
|
|
6392
|
-
throw
|
|
6839
|
+
let t = Mi(e).catch((t) => {
|
|
6840
|
+
throw Ni.delete(e), t;
|
|
6393
6841
|
});
|
|
6394
|
-
return
|
|
6842
|
+
return Ni.set(e, t), t;
|
|
6395
6843
|
}
|
|
6396
|
-
var
|
|
6397
|
-
function
|
|
6398
|
-
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) :
|
|
6844
|
+
var Fi = () => Pi(Ai), Ii = (e) => Pi(`${ki}/three@${Di}/examples/jsm/${e}/+esm`);
|
|
6845
|
+
function Li() {
|
|
6846
|
+
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Pi(ji);
|
|
6399
6847
|
}
|
|
6400
|
-
var
|
|
6401
|
-
function
|
|
6848
|
+
var Ri = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, zi = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
|
|
6849
|
+
function Bi(e, t) {
|
|
6402
6850
|
let n = 0, r = 0, i = 0, a = !0, o = (e) => {
|
|
6403
6851
|
n = requestAnimationFrame(o), i ||= e;
|
|
6404
6852
|
let a = r ? (e - r) / 1e3 : 0;
|
|
@@ -6417,7 +6865,7 @@ function Zr(e, t) {
|
|
|
6417
6865
|
s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
|
|
6418
6866
|
};
|
|
6419
6867
|
}
|
|
6420
|
-
function
|
|
6868
|
+
function Vi(e, t, n = {}) {
|
|
6421
6869
|
let r = {
|
|
6422
6870
|
radius: n.distance ?? 4,
|
|
6423
6871
|
polar: n.polar ?? Math.PI / 2.4,
|
|
@@ -6466,13 +6914,13 @@ function Qr(e, t, n = {}) {
|
|
|
6466
6914
|
}
|
|
6467
6915
|
//#endregion
|
|
6468
6916
|
//#region ../ui/src/components/builder/three/views.jsx
|
|
6469
|
-
var
|
|
6470
|
-
function
|
|
6917
|
+
var Hi = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Ui = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, Wi = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, Gi = (e) => typeof e == "string" && !!e.trim();
|
|
6918
|
+
function Ki({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
6471
6919
|
return /* @__PURE__ */ f("div", {
|
|
6472
6920
|
ref: r,
|
|
6473
6921
|
style: {
|
|
6474
6922
|
...P(i),
|
|
6475
|
-
minHeight:
|
|
6923
|
+
minHeight: Hi(n, 320),
|
|
6476
6924
|
display: "flex",
|
|
6477
6925
|
flexDirection: "column",
|
|
6478
6926
|
alignItems: "center",
|
|
@@ -6481,7 +6929,7 @@ function ri({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
6481
6929
|
border: "1px dashed rgba(148,163,184,.55)",
|
|
6482
6930
|
borderRadius: 10,
|
|
6483
6931
|
background: "rgba(148,163,184,.08)",
|
|
6484
|
-
...
|
|
6932
|
+
...oe,
|
|
6485
6933
|
color: "rgba(100,116,139,.95)",
|
|
6486
6934
|
fontSize: 13,
|
|
6487
6935
|
textAlign: "center",
|
|
@@ -6500,24 +6948,24 @@ function ri({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
6500
6948
|
}) : null]
|
|
6501
6949
|
});
|
|
6502
6950
|
}
|
|
6503
|
-
function
|
|
6951
|
+
function qi({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotateDelay: s, cameraControls: c, ar: u, exposure: f, shadow: p, fieldOfView: m, environment: h, style: g, nodeRef: _, inert: v }) {
|
|
6504
6952
|
let [y, b] = l(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = l(!1);
|
|
6505
6953
|
a(() => {
|
|
6506
6954
|
if (y || !e) return;
|
|
6507
6955
|
let t = !0;
|
|
6508
|
-
return
|
|
6956
|
+
return Li().then(() => t && b(!0), () => t && S(!0)), () => {
|
|
6509
6957
|
t = !1;
|
|
6510
6958
|
};
|
|
6511
6959
|
}, [y, e]);
|
|
6512
6960
|
let C = {
|
|
6513
6961
|
display: "block",
|
|
6514
6962
|
width: "100%",
|
|
6515
|
-
minHeight:
|
|
6516
|
-
height:
|
|
6963
|
+
minHeight: Hi(r, 360),
|
|
6964
|
+
height: Hi(r, 360),
|
|
6517
6965
|
backgroundColor: i || "transparent",
|
|
6518
6966
|
...P(g)
|
|
6519
6967
|
};
|
|
6520
|
-
if (!e) return v ? /* @__PURE__ */ d(
|
|
6968
|
+
if (!e) return v ? /* @__PURE__ */ d(Ki, {
|
|
6521
6969
|
nodeRef: _,
|
|
6522
6970
|
style: g,
|
|
6523
6971
|
height: r,
|
|
@@ -6552,13 +7000,13 @@ function ii({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotate
|
|
|
6552
7000
|
poster: t || void 0,
|
|
6553
7001
|
style: C,
|
|
6554
7002
|
"camera-controls": w(!v && c !== !1),
|
|
6555
|
-
"auto-rotate": w(T && !
|
|
6556
|
-
"auto-rotate-delay": T ? String(
|
|
7003
|
+
"auto-rotate": w(T && !Ri()),
|
|
7004
|
+
"auto-rotate-delay": T ? String(Hi(s, 0)) : void 0,
|
|
6557
7005
|
"rotation-per-second": "18deg",
|
|
6558
7006
|
ar: w(!v && u === !0),
|
|
6559
7007
|
"ar-modes": "webxr scene-viewer quick-look",
|
|
6560
|
-
"shadow-intensity": String(
|
|
6561
|
-
exposure: String(
|
|
7008
|
+
"shadow-intensity": String(Ui(p, 100)),
|
|
7009
|
+
exposure: String(Ui(f, 100)),
|
|
6562
7010
|
"field-of-view": m ? `${Number(m)}deg` : void 0,
|
|
6563
7011
|
"environment-image": h && h !== "neutral" ? h : "neutral",
|
|
6564
7012
|
"interaction-prompt": v ? "none" : void 0,
|
|
@@ -6576,7 +7024,7 @@ function ii({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotate
|
|
|
6576
7024
|
}) : null
|
|
6577
7025
|
});
|
|
6578
7026
|
}
|
|
6579
|
-
var
|
|
7027
|
+
var Ji = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), Yi = [
|
|
6580
7028
|
"precision highp float;",
|
|
6581
7029
|
"uniform vec2 u_res;",
|
|
6582
7030
|
"uniform float u_time;",
|
|
@@ -6599,7 +7047,7 @@ var ai = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
6599
7047
|
" return v;",
|
|
6600
7048
|
"}",
|
|
6601
7049
|
""
|
|
6602
|
-
].join("\n"),
|
|
7050
|
+
].join("\n"), Xi = {
|
|
6603
7051
|
gradient: [
|
|
6604
7052
|
"void main(){",
|
|
6605
7053
|
" vec2 uv = gl_FragCoord.xy / u_res;",
|
|
@@ -6651,7 +7099,7 @@ var ai = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
6651
7099
|
"}"
|
|
6652
7100
|
].join("\n")
|
|
6653
7101
|
};
|
|
6654
|
-
function
|
|
7102
|
+
function Zi(e, t) {
|
|
6655
7103
|
let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
|
|
6656
7104
|
if (!n) return t;
|
|
6657
7105
|
let r = parseInt(n[1], 16);
|
|
@@ -6661,7 +7109,7 @@ function ci(e, t) {
|
|
|
6661
7109
|
(r & 255) / 255
|
|
6662
7110
|
];
|
|
6663
7111
|
}
|
|
6664
|
-
function
|
|
7112
|
+
function Qi(e, t, n) {
|
|
6665
7113
|
let r = e.createShader(t);
|
|
6666
7114
|
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
6667
7115
|
let t = e.getShaderInfoLog(r);
|
|
@@ -6669,13 +7117,13 @@ function li(e, t, n) {
|
|
|
6669
7117
|
}
|
|
6670
7118
|
return r;
|
|
6671
7119
|
}
|
|
6672
|
-
function
|
|
7120
|
+
function $i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, scale: s, height: u, interactive: p, style: m, nodeRef: h, inert: g }) {
|
|
6673
7121
|
let _ = c(null), v = c(null), y = c(null), [b, x] = l("");
|
|
6674
7122
|
a(() => () => {
|
|
6675
7123
|
let e = y.current;
|
|
6676
7124
|
y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
|
|
6677
7125
|
}, []);
|
|
6678
|
-
let S = typeof t == "string" && t.trim() ? t :
|
|
7126
|
+
let S = typeof t == "string" && t.trim() ? t : Xi[e] ?? Xi.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = Ui(o, 100), D = Math.max(.05, Ui(s, 100));
|
|
6679
7127
|
return a(() => {
|
|
6680
7128
|
let e = _.current, t = v.current;
|
|
6681
7129
|
if (!e || !t) return;
|
|
@@ -6690,7 +7138,7 @@ function ui({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6690
7138
|
}
|
|
6691
7139
|
let r = null;
|
|
6692
7140
|
try {
|
|
6693
|
-
let e =
|
|
7141
|
+
let e = Qi(n, n.VERTEX_SHADER, Ji), t = Qi(n, n.FRAGMENT_SHADER, Yi + S);
|
|
6694
7142
|
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");
|
|
6695
7143
|
x("");
|
|
6696
7144
|
} catch (e) {
|
|
@@ -6726,28 +7174,28 @@ function ui({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6726
7174
|
};
|
|
6727
7175
|
p !== !1 && t.addEventListener("pointermove", l);
|
|
6728
7176
|
let u = () => {
|
|
6729
|
-
let r =
|
|
7177
|
+
let r = zi(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
|
|
6730
7178
|
(e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
|
|
6731
7179
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
6732
7180
|
d?.observe(t), u();
|
|
6733
|
-
let f =
|
|
6734
|
-
a:
|
|
7181
|
+
let f = Ri(), m = {
|
|
7182
|
+
a: Zi(C, [
|
|
6735
7183
|
.35,
|
|
6736
7184
|
.4,
|
|
6737
7185
|
.95
|
|
6738
7186
|
]),
|
|
6739
|
-
b:
|
|
7187
|
+
b: Zi(w, [
|
|
6740
7188
|
.05,
|
|
6741
7189
|
.06,
|
|
6742
7190
|
.16
|
|
6743
7191
|
]),
|
|
6744
|
-
c:
|
|
7192
|
+
c: Zi(T, [
|
|
6745
7193
|
.95,
|
|
6746
7194
|
.35,
|
|
6747
7195
|
.6
|
|
6748
7196
|
])
|
|
6749
7197
|
}, h = {};
|
|
6750
|
-
return h.stop =
|
|
7198
|
+
return h.stop = Bi(t, (t, r) => {
|
|
6751
7199
|
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?.();
|
|
6752
7200
|
}), () => {
|
|
6753
7201
|
h.stop?.(), d?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i);
|
|
@@ -6766,7 +7214,7 @@ function ui({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6766
7214
|
},
|
|
6767
7215
|
style: {
|
|
6768
7216
|
position: "relative",
|
|
6769
|
-
minHeight:
|
|
7217
|
+
minHeight: Hi(u, 320),
|
|
6770
7218
|
overflow: "hidden",
|
|
6771
7219
|
...P(m)
|
|
6772
7220
|
},
|
|
@@ -6788,7 +7236,7 @@ function ui({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6788
7236
|
justifyContent: "center",
|
|
6789
7237
|
padding: 12,
|
|
6790
7238
|
background: "rgba(15,23,42,.75)",
|
|
6791
|
-
...
|
|
7239
|
+
...oe,
|
|
6792
7240
|
color: "#fecaca",
|
|
6793
7241
|
fontSize: 11,
|
|
6794
7242
|
whiteSpace: "pre-wrap",
|
|
@@ -6798,7 +7246,7 @@ function ui({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6798
7246
|
}) : null]
|
|
6799
7247
|
});
|
|
6800
7248
|
}
|
|
6801
|
-
function
|
|
7249
|
+
function ea(e, t) {
|
|
6802
7250
|
let n = new e.Scene(), r = new e.BoxGeometry();
|
|
6803
7251
|
r.deleteAttribute("uv");
|
|
6804
7252
|
let i = new e.Mesh(r, new e.MeshBasicMaterial({
|
|
@@ -6814,23 +7262,23 @@ function di(e, t) {
|
|
|
6814
7262
|
let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
|
|
6815
7263
|
return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
|
|
6816
7264
|
}
|
|
6817
|
-
var
|
|
6818
|
-
function
|
|
6819
|
-
if (
|
|
6820
|
-
let t =
|
|
7265
|
+
var ta = /* @__PURE__ */ new Map();
|
|
7266
|
+
function na(e) {
|
|
7267
|
+
if (ta.has(e)) return ta.get(e);
|
|
7268
|
+
let t = Ii("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
|
|
6821
7269
|
new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
|
|
6822
7270
|
})).catch((t) => {
|
|
6823
|
-
throw
|
|
7271
|
+
throw ta.delete(e), t;
|
|
6824
7272
|
});
|
|
6825
|
-
return
|
|
7273
|
+
return ta.set(e, t), t;
|
|
6826
7274
|
}
|
|
6827
|
-
function
|
|
7275
|
+
function ra(e, t) {
|
|
6828
7276
|
let n = new e.Box3().setFromObject(t);
|
|
6829
7277
|
if (n.isEmpty()) return t;
|
|
6830
7278
|
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();
|
|
6831
7279
|
return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
|
|
6832
7280
|
}
|
|
6833
|
-
var
|
|
7281
|
+
var ia = {
|
|
6834
7282
|
box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
|
|
6835
7283
|
sphere: (e) => new e.SphereGeometry(.62, 48, 32),
|
|
6836
7284
|
torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
|
|
@@ -6839,50 +7287,50 @@ var hi = {
|
|
|
6839
7287
|
cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
|
|
6840
7288
|
plane: (e) => new e.PlaneGeometry(1.4, 1.4),
|
|
6841
7289
|
capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
|
|
6842
|
-
},
|
|
6843
|
-
function
|
|
6844
|
-
let g = c(null), [_, v] = l(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !
|
|
7290
|
+
}, aa = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
|
|
7291
|
+
function oa({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: o, controls: s, ground: u, height: f, style: p, nodeRef: m, inert: h }) {
|
|
7292
|
+
let g = c(null), [_, v] = l(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !Ri(), S = s !== !1 && !h;
|
|
6845
7293
|
return a(() => {
|
|
6846
7294
|
let e = g.current;
|
|
6847
7295
|
if (!e) return;
|
|
6848
7296
|
let i = !0, a = null;
|
|
6849
|
-
return
|
|
7297
|
+
return Fi().then((s) => {
|
|
6850
7298
|
if (!i || !e) return;
|
|
6851
7299
|
let c = new s.WebGLRenderer({
|
|
6852
7300
|
antialias: !0,
|
|
6853
7301
|
alpha: !t
|
|
6854
7302
|
});
|
|
6855
|
-
c.setPixelRatio(
|
|
7303
|
+
c.setPixelRatio(zi()), c.shadowMap.enabled = u !== !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);
|
|
6856
7304
|
let l = new s.Scene();
|
|
6857
|
-
t && (l.background = new s.Color(t)), l.environment =
|
|
6858
|
-
let d = new s.PerspectiveCamera(
|
|
6859
|
-
distance:
|
|
7305
|
+
t && (l.background = new s.Color(t)), l.environment = ea(s, c);
|
|
7306
|
+
let d = new s.PerspectiveCamera(aa(r, 45), 1, .1, 400), f = Vi(d, c.domElement, {
|
|
7307
|
+
distance: aa(n, 5),
|
|
6860
7308
|
enableZoom: S
|
|
6861
7309
|
}), p = new s.DirectionalLight(16777215, 2.2);
|
|
6862
7310
|
p.position.set(4, 7, 5), p.castShadow = u !== !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));
|
|
6863
7311
|
let m = [], h = new s.Group(), g = (e, t) => {
|
|
6864
|
-
let n =
|
|
6865
|
-
e.position.set(
|
|
7312
|
+
let n = aa(t.scale, 1);
|
|
7313
|
+
e.position.set(aa(t.x, 0), aa(t.y, 0), aa(t.z, 0)), e.rotation.set(Wi(t.rx), Wi(t.ry), Wi(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = Wi(t.spin);
|
|
6866
7314
|
};
|
|
6867
7315
|
for (let e of y) {
|
|
6868
7316
|
if (e.shape === "model") {
|
|
6869
|
-
if (!
|
|
7317
|
+
if (!Gi(e.src)) continue;
|
|
6870
7318
|
let t = new s.Group();
|
|
6871
|
-
g(t, e), h.add(t),
|
|
7319
|
+
g(t, e), h.add(t), na(e.src).then((e) => {
|
|
6872
7320
|
if (!i) return;
|
|
6873
|
-
let n =
|
|
7321
|
+
let n = ra(s, e.clone(!0));
|
|
6874
7322
|
n.traverse((e) => {
|
|
6875
7323
|
e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
|
|
6876
7324
|
}), t.add(n);
|
|
6877
7325
|
}, () => {});
|
|
6878
7326
|
continue;
|
|
6879
7327
|
}
|
|
6880
|
-
let t = (
|
|
7328
|
+
let t = (ia[e.shape] ?? ia.box)(s), n = new s.MeshStandardMaterial({
|
|
6881
7329
|
color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
|
|
6882
|
-
metalness: Math.min(1, Math.max(0,
|
|
6883
|
-
roughness: Math.min(1, Math.max(0,
|
|
6884
|
-
transparent:
|
|
6885
|
-
opacity: Math.min(1, Math.max(0,
|
|
7330
|
+
metalness: Math.min(1, Math.max(0, Ui(e.metalness, 10))),
|
|
7331
|
+
roughness: Math.min(1, Math.max(0, Ui(e.roughness, 35))),
|
|
7332
|
+
transparent: Ui(e.opacity, 100) < 1,
|
|
7333
|
+
opacity: Math.min(1, Math.max(0, Ui(e.opacity, 100))),
|
|
6886
7334
|
flatShading: e.flat === !0,
|
|
6887
7335
|
wireframe: e.wireframe === !0,
|
|
6888
7336
|
side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
|
|
@@ -6893,14 +7341,14 @@ function _i({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
6893
7341
|
let _ = null;
|
|
6894
7342
|
if (u !== !1) {
|
|
6895
7343
|
let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
|
|
6896
|
-
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y =
|
|
7344
|
+
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = aa(u === !0 ? 0 : u, -.85), _.receiveShadow = !0, l.add(_), m.push(t, e);
|
|
6897
7345
|
}
|
|
6898
7346
|
let v = () => {
|
|
6899
7347
|
let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
|
|
6900
7348
|
c.setSize(t, n, !1), d.aspect = t / n, d.updateProjectionMatrix();
|
|
6901
7349
|
}, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
|
|
6902
7350
|
b?.observe(e), v();
|
|
6903
|
-
let C =
|
|
7351
|
+
let C = Wi(Number.isFinite(Number(o)) ? o : 20), w = Bi(e, (e) => {
|
|
6904
7352
|
f.autoSpin(x ? C : 0, e), f.update();
|
|
6905
7353
|
for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
|
|
6906
7354
|
c.render(l, d);
|
|
@@ -6924,7 +7372,7 @@ function _i({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
6924
7372
|
o,
|
|
6925
7373
|
S,
|
|
6926
7374
|
u
|
|
6927
|
-
]), _ && h ? /* @__PURE__ */ d(
|
|
7375
|
+
]), _ && h ? /* @__PURE__ */ d(Ki, {
|
|
6928
7376
|
nodeRef: m,
|
|
6929
7377
|
style: p,
|
|
6930
7378
|
height: f,
|
|
@@ -6935,27 +7383,27 @@ function _i({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
6935
7383
|
g.current = e, typeof m == "function" && m(e);
|
|
6936
7384
|
},
|
|
6937
7385
|
style: {
|
|
6938
|
-
minHeight:
|
|
6939
|
-
height:
|
|
7386
|
+
minHeight: Hi(f, 380),
|
|
7387
|
+
height: Hi(f, 380),
|
|
6940
7388
|
overflow: "hidden",
|
|
6941
7389
|
touchAction: S ? "pan-y" : void 0,
|
|
6942
7390
|
...P(p)
|
|
6943
7391
|
}
|
|
6944
7392
|
});
|
|
6945
7393
|
}
|
|
6946
|
-
function
|
|
7394
|
+
function sa({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o }) {
|
|
6947
7395
|
let s = c(null), [u, f] = l("");
|
|
6948
7396
|
return a(() => {
|
|
6949
7397
|
let t = s.current;
|
|
6950
7398
|
if (o || !t || typeof e != "string" || !e.trim()) return;
|
|
6951
7399
|
let r = !0, i = null;
|
|
6952
|
-
return
|
|
7400
|
+
return Fi().then((a) => {
|
|
6953
7401
|
if (!r || !t) return;
|
|
6954
7402
|
let o = new a.WebGLRenderer({
|
|
6955
7403
|
antialias: !0,
|
|
6956
7404
|
alpha: !n
|
|
6957
7405
|
});
|
|
6958
|
-
o.setPixelRatio(
|
|
7406
|
+
o.setPixelRatio(zi()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
|
|
6959
7407
|
let s = new a.Scene();
|
|
6960
7408
|
n && (s.background = new a.Color(n));
|
|
6961
7409
|
let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
|
|
@@ -6978,7 +7426,7 @@ function vi({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
6978
7426
|
o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
|
|
6979
7427
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
6980
7428
|
d?.observe(t), u();
|
|
6981
|
-
let p = !1, m =
|
|
7429
|
+
let p = !1, m = Bi(t, (e, t) => {
|
|
6982
7430
|
if (!p && typeof l?.frame == "function") try {
|
|
6983
7431
|
l.frame(e, t);
|
|
6984
7432
|
} catch (e) {
|
|
@@ -7000,7 +7448,7 @@ function vi({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
7000
7448
|
e,
|
|
7001
7449
|
o,
|
|
7002
7450
|
n
|
|
7003
|
-
]), o ? /* @__PURE__ */ d(
|
|
7451
|
+
]), o ? /* @__PURE__ */ d(Ki, {
|
|
7004
7452
|
nodeRef: i,
|
|
7005
7453
|
style: r,
|
|
7006
7454
|
height: t,
|
|
@@ -7011,8 +7459,8 @@ function vi({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
7011
7459
|
s.current = e, typeof i == "function" && i(e);
|
|
7012
7460
|
},
|
|
7013
7461
|
style: {
|
|
7014
|
-
minHeight:
|
|
7015
|
-
height:
|
|
7462
|
+
minHeight: Hi(t, 380),
|
|
7463
|
+
height: Hi(t, 380),
|
|
7016
7464
|
overflow: "hidden",
|
|
7017
7465
|
position: "relative",
|
|
7018
7466
|
touchAction: "pan-y",
|
|
@@ -7027,7 +7475,7 @@ function vi({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
7027
7475
|
padding: "6px 8px",
|
|
7028
7476
|
borderRadius: 6,
|
|
7029
7477
|
background: "rgba(127,29,29,.85)",
|
|
7030
|
-
...
|
|
7478
|
+
...oe,
|
|
7031
7479
|
color: "#fee2e2",
|
|
7032
7480
|
fontSize: 11
|
|
7033
7481
|
},
|
|
@@ -7035,40 +7483,40 @@ function vi({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
7035
7483
|
}) : null
|
|
7036
7484
|
});
|
|
7037
7485
|
}
|
|
7038
|
-
var
|
|
7039
|
-
ModelViewerBlock:
|
|
7040
|
-
ShaderBlock:
|
|
7041
|
-
SceneBlock:
|
|
7042
|
-
ThreeCanvasBlock:
|
|
7043
|
-
},
|
|
7044
|
-
function
|
|
7045
|
-
if (
|
|
7486
|
+
var ca = {
|
|
7487
|
+
ModelViewerBlock: qi,
|
|
7488
|
+
ShaderBlock: $i,
|
|
7489
|
+
SceneBlock: oa,
|
|
7490
|
+
ThreeCanvasBlock: sa
|
|
7491
|
+
}, la = /* @__PURE__ */ new Map();
|
|
7492
|
+
function ua(e) {
|
|
7493
|
+
if (la.has(e)) return la.get(e);
|
|
7046
7494
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
7047
7495
|
/* @vite-ignore */
|
|
7048
7496
|
/* webpackIgnore: true */
|
|
7049
7497
|
t
|
|
7050
7498
|
).finally(() => URL.revokeObjectURL(t));
|
|
7051
|
-
return
|
|
7499
|
+
return la.set(e, n), n;
|
|
7052
7500
|
}
|
|
7053
|
-
function
|
|
7501
|
+
function da(e) {
|
|
7054
7502
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
7055
7503
|
return n && typeof n == "object" ? n : {};
|
|
7056
7504
|
}
|
|
7057
7505
|
//#endregion
|
|
7058
7506
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
7059
|
-
async function
|
|
7060
|
-
let n = await
|
|
7507
|
+
async function fa(e, t) {
|
|
7508
|
+
let n = await ua(e);
|
|
7061
7509
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
7062
7510
|
}
|
|
7063
|
-
var
|
|
7511
|
+
var pa = {
|
|
7064
7512
|
padding: "10px 12px",
|
|
7065
7513
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
7066
7514
|
borderRadius: 8,
|
|
7067
7515
|
fontSize: 12,
|
|
7068
7516
|
opacity: .6
|
|
7069
7517
|
};
|
|
7070
|
-
function
|
|
7071
|
-
let s = i(
|
|
7518
|
+
function ma({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
7519
|
+
let s = i(Q), l = da(s?.settings)[e], u = c(null), p = c(null), m = {
|
|
7072
7520
|
tenant: s?.tenant ?? "",
|
|
7073
7521
|
apiUrl: s?.apiUrl ?? "/api",
|
|
7074
7522
|
locale: s?.locale ?? "",
|
|
@@ -7080,7 +7528,7 @@ function Ti({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
7080
7528
|
let e = u.current;
|
|
7081
7529
|
if (!l?.code || !e) return;
|
|
7082
7530
|
let n = !0;
|
|
7083
|
-
return
|
|
7531
|
+
return fa(l.code, t).then((e) => {
|
|
7084
7532
|
if (!(!n || !e || !u.current)) {
|
|
7085
7533
|
p.current = e;
|
|
7086
7534
|
try {
|
|
@@ -7110,7 +7558,7 @@ function Ti({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
7110
7558
|
}) : /* @__PURE__ */ f("div", {
|
|
7111
7559
|
ref: o,
|
|
7112
7560
|
style: {
|
|
7113
|
-
...
|
|
7561
|
+
...pa,
|
|
7114
7562
|
...P(r)
|
|
7115
7563
|
},
|
|
7116
7564
|
children: [
|
|
@@ -7122,13 +7570,13 @@ function Ti({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
7122
7570
|
}
|
|
7123
7571
|
//#endregion
|
|
7124
7572
|
//#region ../ui/src/components/builder/render.jsx
|
|
7125
|
-
var
|
|
7126
|
-
...
|
|
7127
|
-
...
|
|
7128
|
-
...
|
|
7129
|
-
PluginBlock:
|
|
7573
|
+
var ha = {
|
|
7574
|
+
...qr,
|
|
7575
|
+
...Ei,
|
|
7576
|
+
...ca,
|
|
7577
|
+
PluginBlock: ma
|
|
7130
7578
|
};
|
|
7131
|
-
function
|
|
7579
|
+
function ga(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
7132
7580
|
let o = n[e];
|
|
7133
7581
|
if (!o || o.hidden) return null;
|
|
7134
7582
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -7136,11 +7584,11 @@ function Di(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7136
7584
|
let n = o.props?.componentId, s = r?.[n];
|
|
7137
7585
|
if (!s?.template || i.has(n)) return null;
|
|
7138
7586
|
let c = new Set(i).add(n);
|
|
7139
|
-
return /* @__PURE__ */ d(t, { children:
|
|
7587
|
+
return /* @__PURE__ */ d(t, { children: ga(s.template.rootId, s.template.nodes, r, c, a) }, e);
|
|
7140
7588
|
}
|
|
7141
|
-
let l =
|
|
7589
|
+
let l = ha[s];
|
|
7142
7590
|
if (!l) return null;
|
|
7143
|
-
let u = (o.nodes ?? []).map((e) =>
|
|
7591
|
+
let u = (o.nodes ?? []).map((e) => ga(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, ga(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ d(l, {
|
|
7144
7592
|
...c,
|
|
7145
7593
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
7146
7594
|
linked: p,
|
|
@@ -7149,16 +7597,16 @@ function Di(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7149
7597
|
},
|
|
7150
7598
|
children: u.length ? u : void 0
|
|
7151
7599
|
}, e);
|
|
7152
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ d(
|
|
7600
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ d(ri, {
|
|
7153
7601
|
when: c.when,
|
|
7154
7602
|
children: m
|
|
7155
7603
|
}, e) : m;
|
|
7156
7604
|
}
|
|
7157
7605
|
//#endregion
|
|
7158
7606
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
7159
|
-
var
|
|
7160
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
7161
|
-
function
|
|
7607
|
+
var _a = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), va = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(Ge(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
7608
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(Ge(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
7609
|
+
function ya({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, animations: c, tenant: l, apiUrl: u, datasets: p, locale: m, direction: g, settings: _, siteUser: v }) {
|
|
7162
7610
|
let y = o?.js?.trim();
|
|
7163
7611
|
if (a(() => {
|
|
7164
7612
|
if (!y) return;
|
|
@@ -7172,35 +7620,35 @@ function Ai({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
7172
7620
|
minHeight: "100%",
|
|
7173
7621
|
display: "flex",
|
|
7174
7622
|
flexDirection: "column"
|
|
7175
|
-
}, w =
|
|
7623
|
+
}, w = ga("ROOT", e, n), T = s(() => ({ render: (t, r) => ga(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = ae(e, n), O = ie(e, n), k = o?.css?.trim(), j = S(c), M = We(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !Ve[e]), P = [.../* @__PURE__ */ new Set([...A(e, n), ...N])].map((e) => /* @__PURE__ */ d("link", {
|
|
7176
7624
|
rel: "stylesheet",
|
|
7177
7625
|
precedence: "default",
|
|
7178
7626
|
href: D(e)
|
|
7179
|
-
}, e)), F =
|
|
7180
|
-
return r === "auto" ? /* @__PURE__ */ d(
|
|
7627
|
+
}, e)), F = va(M);
|
|
7628
|
+
return r === "auto" ? /* @__PURE__ */ d(Q.Provider, {
|
|
7181
7629
|
value: {
|
|
7182
7630
|
tenant: l || "",
|
|
7183
7631
|
apiUrl: u || "/api",
|
|
7184
7632
|
locale: m || "",
|
|
7185
7633
|
settings: _ ?? null
|
|
7186
7634
|
},
|
|
7187
|
-
children: /* @__PURE__ */ d(
|
|
7635
|
+
children: /* @__PURE__ */ d(ni, {
|
|
7188
7636
|
initialUser: v,
|
|
7189
|
-
children: /* @__PURE__ */ d(
|
|
7637
|
+
children: /* @__PURE__ */ d(Qe.Provider, {
|
|
7190
7638
|
value: p ?? null,
|
|
7191
|
-
children: /* @__PURE__ */ d(
|
|
7639
|
+
children: /* @__PURE__ */ d(nt.Provider, {
|
|
7192
7640
|
value: T,
|
|
7193
7641
|
children: /* @__PURE__ */ f("div", {
|
|
7194
7642
|
...b,
|
|
7195
7643
|
className: "webim-page",
|
|
7196
7644
|
style: {
|
|
7197
7645
|
...C,
|
|
7198
|
-
...
|
|
7646
|
+
...Ke(t),
|
|
7199
7647
|
...i
|
|
7200
7648
|
},
|
|
7201
7649
|
children: [
|
|
7202
|
-
/* @__PURE__ */ d("style", { children: `.webim-page { ${
|
|
7203
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
7650
|
+
/* @__PURE__ */ d("style", { children: `.webim-page { ${_a(Ge(M.light))} }
|
|
7651
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${_a(Ge(M.dark))} } }` }),
|
|
7204
7652
|
/* @__PURE__ */ d("style", { children: F }),
|
|
7205
7653
|
P,
|
|
7206
7654
|
/* @__PURE__ */ d("style", { children: x }),
|
|
@@ -7213,25 +7661,25 @@ function Ai({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
7213
7661
|
})
|
|
7214
7662
|
})
|
|
7215
7663
|
})
|
|
7216
|
-
}) : /* @__PURE__ */ d(
|
|
7664
|
+
}) : /* @__PURE__ */ d(Q.Provider, {
|
|
7217
7665
|
value: {
|
|
7218
7666
|
tenant: l || "",
|
|
7219
7667
|
apiUrl: u || "/api",
|
|
7220
7668
|
locale: m || "",
|
|
7221
7669
|
settings: _ ?? null
|
|
7222
7670
|
},
|
|
7223
|
-
children: /* @__PURE__ */ d(
|
|
7671
|
+
children: /* @__PURE__ */ d(ni, {
|
|
7224
7672
|
initialUser: v,
|
|
7225
|
-
children: /* @__PURE__ */ d(
|
|
7673
|
+
children: /* @__PURE__ */ d(Qe.Provider, {
|
|
7226
7674
|
value: p ?? null,
|
|
7227
|
-
children: /* @__PURE__ */ d(
|
|
7675
|
+
children: /* @__PURE__ */ d(nt.Provider, {
|
|
7228
7676
|
value: T,
|
|
7229
7677
|
children: /* @__PURE__ */ f("div", {
|
|
7230
7678
|
...b,
|
|
7231
7679
|
className: "webim-page",
|
|
7232
7680
|
style: {
|
|
7233
7681
|
...C,
|
|
7234
|
-
...
|
|
7682
|
+
...Ye(t, r),
|
|
7235
7683
|
...i
|
|
7236
7684
|
},
|
|
7237
7685
|
children: [
|
|
@@ -7253,8 +7701,8 @@ function Ai({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
7253
7701
|
}
|
|
7254
7702
|
//#endregion
|
|
7255
7703
|
//#region src/WebimContent.jsx
|
|
7256
|
-
function
|
|
7257
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ d(
|
|
7704
|
+
function ba({ bundle: e, mode: t = "auto", style: n }) {
|
|
7705
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ d(ya, {
|
|
7258
7706
|
blocks: e.blocks,
|
|
7259
7707
|
theme: e.theme,
|
|
7260
7708
|
components: e.components,
|
|
@@ -7266,13 +7714,13 @@ function ji({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
7266
7714
|
locale: e.locale,
|
|
7267
7715
|
direction: e.direction,
|
|
7268
7716
|
settings: e.settings,
|
|
7269
|
-
mode:
|
|
7717
|
+
mode: Ze(t, e.scheme),
|
|
7270
7718
|
style: n
|
|
7271
7719
|
}) : null;
|
|
7272
7720
|
}
|
|
7273
7721
|
//#endregion
|
|
7274
7722
|
//#region src/bundle.js
|
|
7275
|
-
function
|
|
7723
|
+
function xa({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
7276
7724
|
let a = {
|
|
7277
7725
|
...t?.global ?? {},
|
|
7278
7726
|
...t?.tenant ?? {}
|
|
@@ -7282,7 +7730,7 @@ function Mi({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
7282
7730
|
title: e.title,
|
|
7283
7731
|
slug: e.slug,
|
|
7284
7732
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
7285
|
-
theme:
|
|
7733
|
+
theme: Xe(o, a.builder_themes?.themes),
|
|
7286
7734
|
components: a.builder_components?.components ?? {},
|
|
7287
7735
|
custom: o.custom,
|
|
7288
7736
|
animations: o.animations,
|
|
@@ -7298,18 +7746,18 @@ function Mi({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
7298
7746
|
}
|
|
7299
7747
|
//#endregion
|
|
7300
7748
|
//#region src/fetchPage.js
|
|
7301
|
-
var
|
|
7749
|
+
var Sa = async (e) => {
|
|
7302
7750
|
let t = await e.json().catch(() => null);
|
|
7303
7751
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
7304
7752
|
return t?.payload ?? t;
|
|
7305
7753
|
};
|
|
7306
|
-
async function
|
|
7754
|
+
async function Ca({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
7307
7755
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
7308
7756
|
if (!n) throw Error("fetchPage: slug is required");
|
|
7309
7757
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
7310
7758
|
...t ? { "x-tenant": t } : {},
|
|
7311
7759
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
7312
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
7760
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Sa), c(`${l}/settings/public`, { headers: u }).then(Sa)]), p = xa({
|
|
7313
7761
|
page: d,
|
|
7314
7762
|
settings: f,
|
|
7315
7763
|
tenant: t,
|
|
@@ -7324,7 +7772,7 @@ async function Pi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
7324
7772
|
"LogoCarousel"
|
|
7325
7773
|
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
7326
7774
|
if (m.length) {
|
|
7327
|
-
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(
|
|
7775
|
+
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(Sa).then((e) => {
|
|
7328
7776
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
7329
7777
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
7330
7778
|
}).catch(() => [[t, []]])));
|
|
@@ -7338,40 +7786,40 @@ async function Pi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
7338
7786
|
}
|
|
7339
7787
|
//#endregion
|
|
7340
7788
|
//#region src/ssr.jsx
|
|
7341
|
-
var
|
|
7789
|
+
var wa = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
7342
7790
|
"&": "&",
|
|
7343
7791
|
"<": "<",
|
|
7344
7792
|
">": ">",
|
|
7345
7793
|
"\"": """
|
|
7346
7794
|
})[e]);
|
|
7347
|
-
function
|
|
7348
|
-
return e(/* @__PURE__ */ d(
|
|
7795
|
+
function Ta(t, { mode: n = "auto", style: r } = {}) {
|
|
7796
|
+
return e(/* @__PURE__ */ d(ba, {
|
|
7349
7797
|
bundle: t,
|
|
7350
7798
|
mode: n,
|
|
7351
7799
|
style: r
|
|
7352
7800
|
}));
|
|
7353
7801
|
}
|
|
7354
|
-
function
|
|
7802
|
+
function Ea(e, { mode: t = "auto", lang: n } = {}) {
|
|
7355
7803
|
let r = e.seo ?? {}, i = n || e.locale || "en", a = h(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
|
|
7356
7804
|
"<meta charset=\"utf-8\"/>",
|
|
7357
7805
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
7358
|
-
`<title>${
|
|
7359
|
-
r.description && `<meta name="description" content="${
|
|
7360
|
-
`<meta property="og:title" content="${
|
|
7361
|
-
r.image && `<meta property="og:image" content="${
|
|
7806
|
+
`<title>${wa(o)}</title>`,
|
|
7807
|
+
r.description && `<meta name="description" content="${wa(r.description)}"/>`,
|
|
7808
|
+
`<meta property="og:title" content="${wa(o)}"/>`,
|
|
7809
|
+
r.image && `<meta property="og:image" content="${wa(r.image)}"/>`,
|
|
7362
7810
|
r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
|
|
7363
7811
|
"<style>html,body{margin:0;height:100%}</style>"
|
|
7364
7812
|
].filter(Boolean).join("\n");
|
|
7365
7813
|
return `<!doctype html>
|
|
7366
|
-
<html lang="${
|
|
7814
|
+
<html lang="${wa(i)}"${a ? ` dir="${a}"` : ""}>
|
|
7367
7815
|
<head>
|
|
7368
7816
|
${c}
|
|
7369
7817
|
</head>
|
|
7370
7818
|
<body>
|
|
7371
|
-
${
|
|
7819
|
+
${Ta(e, { mode: t })}
|
|
7372
7820
|
${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
7373
7821
|
</body>
|
|
7374
7822
|
</html>`;
|
|
7375
7823
|
}
|
|
7376
7824
|
//#endregion
|
|
7377
|
-
export {
|
|
7825
|
+
export { xa as assembleBundle, Ca as fetchPage, Ta as renderBundleHtml, Ea as renderPageDocument };
|