webim-adapter 2.6.6 → 2.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/webim-adapter.js +808 -761
- package/build/webim-embed.js +28 -28
- package/build/webim-ssr.js +822 -775
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -2382,43 +2382,56 @@ function lr(e, t, n = "directions", r = "") {
|
|
|
2382
2382
|
let i = `${e},${t}`;
|
|
2383
2383
|
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)}`;
|
|
2384
2384
|
}
|
|
2385
|
-
var ur =
|
|
2386
|
-
|
|
2387
|
-
|
|
2385
|
+
var ur = "https://tile.openstreetmap.org/{z}/{x}/{y}.png", dr = (e) => {
|
|
2386
|
+
let t = String(e ?? "").trim();
|
|
2387
|
+
return /^https?:\/\//i.test(t) && t.includes("{z}") && t.includes("{x}") && t.includes("{y}") ? t : ur;
|
|
2388
|
+
}, fr = (e) => {
|
|
2389
|
+
try {
|
|
2390
|
+
return new URL(e.replace(/[{}]/g, "")).host;
|
|
2391
|
+
} catch {
|
|
2392
|
+
return e;
|
|
2393
|
+
}
|
|
2394
|
+
}, pr = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
|
|
2395
|
+
function mr({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize: a = 22, pinLink: o = "directions", link: c = !1, label: l = "", tileUrl: f = "", tileError: p = "", style: m, nodeRef: _, inert: v }) {
|
|
2396
|
+
let y = u(null), [b, x] = d(1200), S = dr(f), [C, w] = d({
|
|
2397
|
+
key: "",
|
|
2398
|
+
failed: 0,
|
|
2399
|
+
loaded: 0
|
|
2400
|
+
});
|
|
2388
2401
|
s(() => {
|
|
2389
|
-
let e =
|
|
2402
|
+
let e = y.current;
|
|
2390
2403
|
if (!e || typeof ResizeObserver > "u") return;
|
|
2391
|
-
let t = () =>
|
|
2404
|
+
let t = () => x((t) => e.clientWidth && e.clientWidth !== t ? e.clientWidth : t);
|
|
2392
2405
|
t();
|
|
2393
2406
|
let n = new ResizeObserver(t);
|
|
2394
2407
|
return n.observe(e), () => n.disconnect();
|
|
2395
2408
|
}, []);
|
|
2396
|
-
let
|
|
2409
|
+
let T = (Array.isArray(e) ? e : []).filter(cr), E = cr({
|
|
2397
2410
|
lat: t,
|
|
2398
2411
|
lng: n
|
|
2399
2412
|
}) ? {
|
|
2400
2413
|
lat: sr(t, 90),
|
|
2401
2414
|
lng: sr(n, 180)
|
|
2402
|
-
} :
|
|
2403
|
-
lat:
|
|
2404
|
-
lng:
|
|
2405
|
-
} : null,
|
|
2406
|
-
if (
|
|
2415
|
+
} : T.length ? {
|
|
2416
|
+
lat: T.reduce((e, t) => e + sr(t.lat, 90), 0) / T.length,
|
|
2417
|
+
lng: T.reduce((e, t) => e + sr(t.lng, 180), 0) / T.length
|
|
2418
|
+
} : null, D = Math.max(80, Number(i) || 320), O = sr(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
|
|
2419
|
+
if (T.length < 2) return 13;
|
|
2407
2420
|
for (let e = 19; e >= 1; e--) {
|
|
2408
|
-
let t =
|
|
2409
|
-
if (n <=
|
|
2421
|
+
let t = T.map((t) => or(sr(t.lat, 90), sr(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));
|
|
2422
|
+
if (n <= b * .8 && r <= D * .7) return e;
|
|
2410
2423
|
}
|
|
2411
2424
|
return 1;
|
|
2412
|
-
})(),
|
|
2425
|
+
})(), k = {
|
|
2413
2426
|
width: "100%",
|
|
2414
|
-
...U(
|
|
2427
|
+
...U(m)
|
|
2415
2428
|
};
|
|
2416
|
-
if (!
|
|
2429
|
+
if (!E) return /* @__PURE__ */ h("div", {
|
|
2417
2430
|
ref: (e) => {
|
|
2418
|
-
|
|
2431
|
+
y.current = e, typeof _ == "function" && _(e);
|
|
2419
2432
|
},
|
|
2420
2433
|
style: {
|
|
2421
|
-
...
|
|
2434
|
+
...k,
|
|
2422
2435
|
minHeight: 80,
|
|
2423
2436
|
display: "grid",
|
|
2424
2437
|
placeItems: "center",
|
|
@@ -2429,51 +2442,85 @@ function dr({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
2429
2442
|
},
|
|
2430
2443
|
children: "Set the coordinates in Settings"
|
|
2431
2444
|
});
|
|
2432
|
-
let
|
|
2433
|
-
x:
|
|
2434
|
-
y:
|
|
2435
|
-
},
|
|
2436
|
-
for (let e = Math.floor(
|
|
2437
|
-
for (let e = Math.floor(
|
|
2438
|
-
let
|
|
2445
|
+
let A = or(E.lat, E.lng, O), j = {
|
|
2446
|
+
x: A.x - b / 2,
|
|
2447
|
+
y: A.y - D / 2
|
|
2448
|
+
}, M = [], N = [];
|
|
2449
|
+
for (let e = Math.floor(j.x / ir); e <= Math.floor((j.x + b) / ir); e++) M.push(e);
|
|
2450
|
+
for (let e = Math.floor(j.y / ir); e <= Math.floor((j.y + D) / ir); e++) N.push(e);
|
|
2451
|
+
let P = 2 ** O, F = `${S}|${O}`, I = C.key === F ? C : {
|
|
2452
|
+
key: F,
|
|
2453
|
+
failed: 0,
|
|
2454
|
+
loaded: 0
|
|
2455
|
+
}, L = (e) => w((t) => {
|
|
2456
|
+
let n = t.key === F ? t : {
|
|
2457
|
+
key: F,
|
|
2458
|
+
failed: 0,
|
|
2459
|
+
loaded: 0
|
|
2460
|
+
};
|
|
2461
|
+
return {
|
|
2462
|
+
...n,
|
|
2463
|
+
[e]: n[e] + 1
|
|
2464
|
+
};
|
|
2465
|
+
}), R = I.failed > 0 && I.loaded === 0;
|
|
2439
2466
|
return /* @__PURE__ */ g("div", {
|
|
2440
2467
|
ref: (e) => {
|
|
2441
|
-
|
|
2468
|
+
y.current = e, typeof _ == "function" && _(e);
|
|
2442
2469
|
},
|
|
2443
|
-
style:
|
|
2470
|
+
style: k,
|
|
2444
2471
|
children: [/* @__PURE__ */ g("div", {
|
|
2445
2472
|
role: "img",
|
|
2446
2473
|
"aria-label": l || "Map",
|
|
2447
2474
|
...X("map"),
|
|
2448
2475
|
style: {
|
|
2449
2476
|
position: "relative",
|
|
2450
|
-
height:
|
|
2477
|
+
height: D,
|
|
2451
2478
|
overflow: "hidden",
|
|
2452
2479
|
borderRadius: "inherit",
|
|
2453
2480
|
background: "var(--page-surface, #e5e7eb)"
|
|
2454
2481
|
},
|
|
2455
2482
|
children: [
|
|
2456
|
-
|
|
2457
|
-
let n = (t %
|
|
2458
|
-
return e < 0 || e >=
|
|
2459
|
-
src:
|
|
2483
|
+
N.map((e) => M.map((t) => {
|
|
2484
|
+
let n = (t % P + P) % P;
|
|
2485
|
+
return e < 0 || e >= P ? null : /* @__PURE__ */ h("img", {
|
|
2486
|
+
src: S.replace("{z}", O).replace("{x}", n).replace("{y}", e),
|
|
2460
2487
|
alt: "",
|
|
2488
|
+
onLoad: () => L("loaded"),
|
|
2489
|
+
onError: (e) => {
|
|
2490
|
+
e.currentTarget.style.visibility = "hidden", L("failed");
|
|
2491
|
+
},
|
|
2461
2492
|
width: ir,
|
|
2462
2493
|
height: ir,
|
|
2463
2494
|
loading: "lazy",
|
|
2464
2495
|
style: {
|
|
2465
2496
|
position: "absolute",
|
|
2466
|
-
left: Math.round(t * ir -
|
|
2467
|
-
top: Math.round(e * ir -
|
|
2497
|
+
left: Math.round(t * ir - j.x),
|
|
2498
|
+
top: Math.round(e * ir - j.y),
|
|
2468
2499
|
width: ir,
|
|
2469
2500
|
height: ir,
|
|
2470
2501
|
userSelect: "none",
|
|
2471
2502
|
pointerEvents: "none"
|
|
2472
2503
|
}
|
|
2473
|
-
}, `${t}-${e}`);
|
|
2504
|
+
}, `${F}:${t}-${e}`);
|
|
2474
2505
|
})),
|
|
2475
|
-
|
|
2476
|
-
|
|
2506
|
+
R && v && p ? /* @__PURE__ */ h("div", {
|
|
2507
|
+
style: {
|
|
2508
|
+
...Te,
|
|
2509
|
+
position: "absolute",
|
|
2510
|
+
left: 12,
|
|
2511
|
+
right: 12,
|
|
2512
|
+
top: 12,
|
|
2513
|
+
padding: "8px 12px",
|
|
2514
|
+
borderRadius: 8,
|
|
2515
|
+
background: "rgba(15, 23, 42, 0.78)",
|
|
2516
|
+
color: "#fff",
|
|
2517
|
+
fontSize: 12,
|
|
2518
|
+
lineHeight: 1.45
|
|
2519
|
+
},
|
|
2520
|
+
children: p.replace("{host}", fr(S))
|
|
2521
|
+
}) : null,
|
|
2522
|
+
T.map((e, t) => {
|
|
2523
|
+
let n = or(sr(e.lat, 90), sr(e.lng, 180), O), r = n.x - j.x, i = n.y - j.y, s = e.color || "var(--page-accent, #dc2626)", c = o === "none" || v ? null : lr(sr(e.lat, 90), sr(e.lng, 180), o, e.title);
|
|
2477
2524
|
return /* @__PURE__ */ g(c ? "a" : "span", {
|
|
2478
2525
|
...X("pin"),
|
|
2479
2526
|
href: c || void 0,
|
|
@@ -2514,8 +2561,8 @@ function dr({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
2514
2561
|
viewBox: "0 0 24 24",
|
|
2515
2562
|
fill: s,
|
|
2516
2563
|
style: { display: "block" },
|
|
2517
|
-
children: [/* @__PURE__ */ h("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }),
|
|
2518
|
-
d:
|
|
2564
|
+
children: [/* @__PURE__ */ h("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), hr[e.icon] ? /* @__PURE__ */ h("path", {
|
|
2565
|
+
d: hr[e.icon],
|
|
2519
2566
|
transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
|
|
2520
2567
|
fill: "none",
|
|
2521
2568
|
stroke: "#fff",
|
|
@@ -2535,7 +2582,7 @@ function dr({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
2535
2582
|
href: "https://www.openstreetmap.org/copyright",
|
|
2536
2583
|
target: "_blank",
|
|
2537
2584
|
rel: "noopener noreferrer",
|
|
2538
|
-
onClick:
|
|
2585
|
+
onClick: v ? (e) => e.preventDefault() : void 0,
|
|
2539
2586
|
...X("credit"),
|
|
2540
2587
|
style: {
|
|
2541
2588
|
position: "absolute",
|
|
@@ -2552,10 +2599,10 @@ function dr({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
2552
2599
|
})
|
|
2553
2600
|
]
|
|
2554
2601
|
}), c ? /* @__PURE__ */ h("a", {
|
|
2555
|
-
href:
|
|
2602
|
+
href: pr(E.lat, E.lng, O),
|
|
2556
2603
|
target: "_blank",
|
|
2557
2604
|
rel: "noopener noreferrer",
|
|
2558
|
-
onClick:
|
|
2605
|
+
onClick: v ? (e) => e.preventDefault() : void 0,
|
|
2559
2606
|
...X("link"),
|
|
2560
2607
|
style: {
|
|
2561
2608
|
display: "inline-block",
|
|
@@ -2567,7 +2614,7 @@ function dr({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
2567
2614
|
}) : null]
|
|
2568
2615
|
});
|
|
2569
2616
|
}
|
|
2570
|
-
var
|
|
2617
|
+
var hr = {
|
|
2571
2618
|
check: "M4 12l5 5L20 6",
|
|
2572
2619
|
close: "M6 6l12 12M18 6L6 18",
|
|
2573
2620
|
plus: "M12 5v14M5 12h14",
|
|
@@ -2665,8 +2712,8 @@ var fr = {
|
|
|
2665
2712
|
droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
|
|
2666
2713
|
leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
|
|
2667
2714
|
};
|
|
2668
|
-
function
|
|
2669
|
-
let f = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], p = n && f.length > 0, m = f.length ? f : [
|
|
2715
|
+
function gr({ 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: d }) {
|
|
2716
|
+
let f = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], p = n && f.length > 0, m = f.length ? f : [hr[e] ?? hr.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ h("svg", {
|
|
2670
2717
|
...X("glyph"),
|
|
2671
2718
|
viewBox: "0 0 24 24",
|
|
2672
2719
|
width: g,
|
|
@@ -2703,7 +2750,7 @@ function pr({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
|
|
|
2703
2750
|
children: v
|
|
2704
2751
|
});
|
|
2705
2752
|
}
|
|
2706
|
-
function
|
|
2753
|
+
function _r(e, t = {}, n = 0) {
|
|
2707
2754
|
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : Yt(e), a = Math.max(0, Number(n) || 0), o = [];
|
|
2708
2755
|
for (let e of r) {
|
|
2709
2756
|
let n = e.data ?? e, r = qt(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(qt(n, t.nameField)) : i(n.name), l = t.hrefField ? i(qt(n, t.hrefField)) : "";
|
|
@@ -2716,7 +2763,7 @@ function mr(e, t = {}, n = 0) {
|
|
|
2716
2763
|
}
|
|
2717
2764
|
return o;
|
|
2718
2765
|
}
|
|
2719
|
-
function
|
|
2766
|
+
function vr({ images: e = [], source: t = "", entry: n = "", imageField: r = "", nameField: i = "", hrefField: a = "", limit: c = 0, emptyText: l = "", columns: u = 3, gap: f = 8, showNames: p = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
|
|
2720
2767
|
let { tenant: x, apiUrl: S } = o(Y), C = o(Ft)?.[t], [w, T] = d(null), [E, D] = d(() => /* @__PURE__ */ new Set());
|
|
2721
2768
|
s(() => {
|
|
2722
2769
|
if (!t || C) return;
|
|
@@ -2734,7 +2781,7 @@ function hr({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
2734
2781
|
C
|
|
2735
2782
|
]);
|
|
2736
2783
|
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 ? (() => {
|
|
2737
|
-
let e =
|
|
2784
|
+
let e = _r(k, {
|
|
2738
2785
|
imageField: r,
|
|
2739
2786
|
nameField: i,
|
|
2740
2787
|
hrefField: a
|
|
@@ -2943,19 +2990,19 @@ function hr({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
2943
2990
|
]
|
|
2944
2991
|
});
|
|
2945
2992
|
}
|
|
2946
|
-
var
|
|
2993
|
+
var yr = {
|
|
2947
2994
|
color: "inherit",
|
|
2948
2995
|
textDecoration: "none",
|
|
2949
2996
|
fontSize: 14,
|
|
2950
2997
|
opacity: .85
|
|
2951
|
-
},
|
|
2998
|
+
}, br = $t({
|
|
2952
2999
|
background: "var(--page-surface, #f2f2f2)",
|
|
2953
3000
|
color: "var(--page-text, #111827)",
|
|
2954
3001
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
2955
3002
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
2956
3003
|
zIndex: 60
|
|
2957
3004
|
});
|
|
2958
|
-
function
|
|
3005
|
+
function xr(e, t = {}, n = "dropdown") {
|
|
2959
3006
|
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 ? "" : Yt(e), o = r.map((e) => {
|
|
2960
3007
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
2961
3008
|
return {
|
|
@@ -2997,7 +3044,7 @@ function vr(e, t = {}, n = "dropdown") {
|
|
|
2997
3044
|
type: e.children.length ? n : "link"
|
|
2998
3045
|
}));
|
|
2999
3046
|
}
|
|
3000
|
-
function
|
|
3047
|
+
function Sr({ brand: t, logo: n, brandHref: r, brandTarget: i, links: a = [], style: c, nodeRef: l, menu: u = "auto", breakpoint: f = 768, source: p = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
|
|
3001
3048
|
let [C, w] = d(null), [T, E] = d(!1), [D, O] = d(!1), [k, A] = d(null), { tenant: j, apiUrl: M } = o(Y), N = o(Ft)?.[p], [P, F] = d(null);
|
|
3002
3049
|
s(() => {
|
|
3003
3050
|
if (!p || N) return;
|
|
@@ -3018,7 +3065,7 @@ function yr({ brand: t, logo: n, brandHref: r, brandTarget: i, links: a = [], st
|
|
|
3018
3065
|
let e = new ResizeObserver(() => E(C.offsetWidth < f));
|
|
3019
3066
|
return e.observe(C), () => e.disconnect();
|
|
3020
3067
|
}, [C, f]);
|
|
3021
|
-
let I = p ?
|
|
3068
|
+
let I = p ? xr(N ?? P ?? [], {
|
|
3022
3069
|
labelField: _,
|
|
3023
3070
|
hrefField: v,
|
|
3024
3071
|
imageField: y,
|
|
@@ -3049,7 +3096,7 @@ function yr({ brand: t, logo: n, brandHref: r, brandTarget: i, links: a = [], st
|
|
|
3049
3096
|
...X("sublink", n && "sublink-card"),
|
|
3050
3097
|
href: e.href || "#",
|
|
3051
3098
|
style: {
|
|
3052
|
-
...
|
|
3099
|
+
...yr,
|
|
3053
3100
|
display: n ? "block" : "flex",
|
|
3054
3101
|
alignItems: n ? void 0 : "center",
|
|
3055
3102
|
gap: n ? void 0 : 10,
|
|
@@ -3155,7 +3202,7 @@ function yr({ brand: t, logo: n, brandHref: r, brandTarget: i, links: a = [], st
|
|
|
3155
3202
|
if (!t.length) return /* @__PURE__ */ h("a", {
|
|
3156
3203
|
...X("link"),
|
|
3157
3204
|
href: e.href || "#",
|
|
3158
|
-
style:
|
|
3205
|
+
style: yr,
|
|
3159
3206
|
children: e.label
|
|
3160
3207
|
}, e.key);
|
|
3161
3208
|
let n = e.type === "mega";
|
|
@@ -3170,7 +3217,7 @@ function yr({ brand: t, logo: n, brandHref: r, brandTarget: i, links: a = [], st
|
|
|
3170
3217
|
...X("link"),
|
|
3171
3218
|
href: e.href || "#",
|
|
3172
3219
|
style: {
|
|
3173
|
-
...
|
|
3220
|
+
...yr,
|
|
3174
3221
|
cursor: "pointer"
|
|
3175
3222
|
},
|
|
3176
3223
|
children: [
|
|
@@ -3188,7 +3235,7 @@ function yr({ brand: t, logo: n, brandHref: r, brandTarget: i, links: a = [], st
|
|
|
3188
3235
|
}), k === e.key && (n ? /* @__PURE__ */ h("div", {
|
|
3189
3236
|
...X("mega-panel"),
|
|
3190
3237
|
style: {
|
|
3191
|
-
...
|
|
3238
|
+
...br,
|
|
3192
3239
|
position: "absolute",
|
|
3193
3240
|
left: 0,
|
|
3194
3241
|
right: 0,
|
|
@@ -3205,7 +3252,7 @@ function yr({ brand: t, logo: n, brandHref: r, brandTarget: i, links: a = [], st
|
|
|
3205
3252
|
}) : /* @__PURE__ */ h("div", {
|
|
3206
3253
|
...X("dropdown-panel"),
|
|
3207
3254
|
style: {
|
|
3208
|
-
...
|
|
3255
|
+
...br,
|
|
3209
3256
|
position: "absolute",
|
|
3210
3257
|
top: "100%",
|
|
3211
3258
|
left: 0,
|
|
@@ -3236,7 +3283,7 @@ function yr({ brand: t, logo: n, brandHref: r, brandTarget: i, links: a = [], st
|
|
|
3236
3283
|
...X("mobile-link"),
|
|
3237
3284
|
href: t.href || "#",
|
|
3238
3285
|
style: {
|
|
3239
|
-
...
|
|
3286
|
+
...yr,
|
|
3240
3287
|
padding: "10px 4px",
|
|
3241
3288
|
fontWeight: (t.children ?? []).length ? 600 : 400,
|
|
3242
3289
|
opacity: 1
|
|
@@ -3247,7 +3294,7 @@ function yr({ brand: t, logo: n, brandHref: r, brandTarget: i, links: a = [], st
|
|
|
3247
3294
|
]
|
|
3248
3295
|
});
|
|
3249
3296
|
}
|
|
3250
|
-
function
|
|
3297
|
+
function Cr({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
3251
3298
|
let [i, a] = d(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
3252
3299
|
return e.length ? /* @__PURE__ */ g("div", {
|
|
3253
3300
|
ref: r,
|
|
@@ -3290,13 +3337,13 @@ function br({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
3290
3337
|
}, e.key))]
|
|
3291
3338
|
}) : null;
|
|
3292
3339
|
}
|
|
3293
|
-
function
|
|
3340
|
+
function wr({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: c, openColor: l, borderColor: u, style: f, nodeRef: p }) {
|
|
3294
3341
|
let [m, _] = d(() => new Set(e.length ? [e[0].key] : []));
|
|
3295
3342
|
if (!e.length) return null;
|
|
3296
3343
|
let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
|
|
3297
3344
|
let n = Number(e);
|
|
3298
3345
|
return e === "" || e == null || !Number.isFinite(n) ? t : n;
|
|
3299
|
-
}, b =
|
|
3346
|
+
}, b = hr[r], x = (e) => _((t) => {
|
|
3300
3347
|
let r = new Set(n ? t : []);
|
|
3301
3348
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
3302
3349
|
});
|
|
@@ -3377,11 +3424,11 @@ function xr({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
|
|
|
3377
3424
|
})
|
|
3378
3425
|
});
|
|
3379
3426
|
}
|
|
3380
|
-
var
|
|
3427
|
+
var Tr = {
|
|
3381
3428
|
display: "flex",
|
|
3382
3429
|
flexDirection: "column",
|
|
3383
3430
|
gap: "12px"
|
|
3384
|
-
},
|
|
3431
|
+
}, Er = {
|
|
3385
3432
|
fontSize: "14px",
|
|
3386
3433
|
fontWeight: 500,
|
|
3387
3434
|
color: "var(--page-text, #111827)"
|
|
@@ -3395,18 +3442,18 @@ var Sr = {
|
|
|
3395
3442
|
boxSizing: "border-box",
|
|
3396
3443
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
3397
3444
|
color: "var(--page-text, #111827)"
|
|
3398
|
-
}),
|
|
3445
|
+
}), Dr = {
|
|
3399
3446
|
display: "flex",
|
|
3400
3447
|
alignItems: "center",
|
|
3401
3448
|
gap: "8px",
|
|
3402
3449
|
fontSize: "14px",
|
|
3403
3450
|
color: "var(--page-text, #111827)"
|
|
3404
|
-
},
|
|
3451
|
+
}, Or = (e) => e ? {
|
|
3405
3452
|
readOnly: !0,
|
|
3406
3453
|
tabIndex: -1,
|
|
3407
3454
|
onMouseDown: (e) => e.preventDefault()
|
|
3408
3455
|
} : {};
|
|
3409
|
-
function
|
|
3456
|
+
function kr(e, t) {
|
|
3410
3457
|
if (!e) return !0;
|
|
3411
3458
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
3412
3459
|
switch (e.op) {
|
|
@@ -3420,11 +3467,11 @@ function Er(e, t) {
|
|
|
3420
3467
|
default: return !1;
|
|
3421
3468
|
}
|
|
3422
3469
|
}
|
|
3423
|
-
var
|
|
3470
|
+
var Ar = {
|
|
3424
3471
|
display: "flex",
|
|
3425
3472
|
flexDirection: "column",
|
|
3426
3473
|
gap: 6
|
|
3427
|
-
},
|
|
3474
|
+
}, jr = $t({
|
|
3428
3475
|
font: "inherit",
|
|
3429
3476
|
fontSize: 15,
|
|
3430
3477
|
padding: "10px 12px",
|
|
@@ -3435,18 +3482,18 @@ var Dr = {
|
|
|
3435
3482
|
width: "100%",
|
|
3436
3483
|
boxSizing: "border-box"
|
|
3437
3484
|
});
|
|
3438
|
-
function
|
|
3485
|
+
function Mr(e, t) {
|
|
3439
3486
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
3440
3487
|
if (!e?.parentField) return n;
|
|
3441
3488
|
let r = t?.[e.parentField];
|
|
3442
3489
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
3443
3490
|
}
|
|
3444
|
-
var
|
|
3445
|
-
function
|
|
3491
|
+
var Nr = "g-recaptcha-response", Pr = (e) => e?.type === "recaptcha" ? Nr : e?.name;
|
|
3492
|
+
function Fr({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
3446
3493
|
let a = /* @__PURE__ */ g("span", {
|
|
3447
3494
|
...X("label"),
|
|
3448
3495
|
style: {
|
|
3449
|
-
...
|
|
3496
|
+
...Er,
|
|
3450
3497
|
fontSize: 14
|
|
3451
3498
|
},
|
|
3452
3499
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -3456,7 +3503,7 @@ function Mr({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
3456
3503
|
required: e.required || void 0,
|
|
3457
3504
|
placeholder: e.placeholder || void 0,
|
|
3458
3505
|
disabled: r || void 0,
|
|
3459
|
-
style:
|
|
3506
|
+
style: jr,
|
|
3460
3507
|
value: t ?? "",
|
|
3461
3508
|
onChange: (t) => n(e.name, t.target.value)
|
|
3462
3509
|
};
|
|
@@ -3487,11 +3534,11 @@ function Mr({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
3487
3534
|
borderRadius: 8,
|
|
3488
3535
|
display: "block"
|
|
3489
3536
|
}
|
|
3490
|
-
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ h(
|
|
3537
|
+
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ h(Br, {
|
|
3491
3538
|
theme: e.captchaTheme,
|
|
3492
3539
|
size: e.captchaSize,
|
|
3493
3540
|
inert: r,
|
|
3494
|
-
onChange: (e) => n(
|
|
3541
|
+
onChange: (e) => n(Nr, e)
|
|
3495
3542
|
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ h(Vn, {
|
|
3496
3543
|
url: e.src,
|
|
3497
3544
|
style: { width: "100%" }
|
|
@@ -3506,7 +3553,7 @@ function Mr({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
3506
3553
|
}
|
|
3507
3554
|
}) : null : /* @__PURE__ */ g("label", {
|
|
3508
3555
|
...X("field"),
|
|
3509
|
-
style:
|
|
3556
|
+
style: Ar,
|
|
3510
3557
|
children: [
|
|
3511
3558
|
a,
|
|
3512
3559
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ h("textarea", {
|
|
@@ -3514,7 +3561,7 @@ function Mr({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
3514
3561
|
...X("textarea"),
|
|
3515
3562
|
rows: 4,
|
|
3516
3563
|
style: {
|
|
3517
|
-
...
|
|
3564
|
+
...jr,
|
|
3518
3565
|
resize: "vertical"
|
|
3519
3566
|
}
|
|
3520
3567
|
}) : e.type === "select" ? /* @__PURE__ */ g("select", {
|
|
@@ -3524,7 +3571,7 @@ function Mr({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
3524
3571
|
children: [/* @__PURE__ */ h("option", {
|
|
3525
3572
|
value: "",
|
|
3526
3573
|
children: e.placeholder || "—"
|
|
3527
|
-
}),
|
|
3574
|
+
}), Mr(e, i).map((e, t) => /* @__PURE__ */ h("option", {
|
|
3528
3575
|
value: typeof e == "string" ? e : e.value,
|
|
3529
3576
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
3530
3577
|
}, t))]
|
|
@@ -3574,7 +3621,7 @@ function Mr({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
3574
3621
|
]
|
|
3575
3622
|
});
|
|
3576
3623
|
}
|
|
3577
|
-
function
|
|
3624
|
+
function Ir({ style: e, action: t, method: n, name: r, enctype: i, formSlug: a, auto: c, submitLabel: l, nodeRef: u, inert: f, children: p, linked: _, show: v }) {
|
|
3578
3625
|
let { tenant: y, apiUrl: b } = o(Y), [x, S] = d("form"), [C, w] = d(null), [T, E] = d({}), [D, O] = d(0), k = f ? v || "form" : x;
|
|
3579
3626
|
s(() => {
|
|
3580
3627
|
if (!c || !a) return;
|
|
@@ -3596,11 +3643,11 @@ function Nr({ style: e, action: t, method: n, name: r, enctype: i, formSlug: a,
|
|
|
3596
3643
|
section: e,
|
|
3597
3644
|
fields: []
|
|
3598
3645
|
}) : A[A.length - 1].fields.push(e);
|
|
3599
|
-
let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section ||
|
|
3646
|
+
let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section || kr(e.section.condition, T)).map((e) => ({
|
|
3600
3647
|
...e,
|
|
3601
|
-
fields: e.fields.filter((e) =>
|
|
3648
|
+
fields: e.fields.filter((e) => kr(e.condition, T))
|
|
3602
3649
|
})), N = j.length > 1, P = Math.min(D, Math.max(0, M.length - 1)), F = N ? M[P]?.fields ?? [] : M.flatMap((e) => e.fields), I = F.filter((e) => {
|
|
3603
|
-
let t = T[
|
|
3650
|
+
let t = T[Pr(e)];
|
|
3604
3651
|
return e.required && (t == null || t === "" || t === !1);
|
|
3605
3652
|
}), L = P >= M.length - 1, R = (e, t) => E((n) => {
|
|
3606
3653
|
let r = {
|
|
@@ -3656,11 +3703,11 @@ function Nr({ style: e, action: t, method: n, name: r, enctype: i, formSlug: a,
|
|
|
3656
3703
|
}
|
|
3657
3704
|
},
|
|
3658
3705
|
style: {
|
|
3659
|
-
...
|
|
3706
|
+
...Tr,
|
|
3660
3707
|
display: k === "success" ? "none" : "flex"
|
|
3661
3708
|
},
|
|
3662
3709
|
children: c && a ? /* @__PURE__ */ g(m, { children: [
|
|
3663
|
-
N && /* @__PURE__ */ h(
|
|
3710
|
+
N && /* @__PURE__ */ h(gi, {
|
|
3664
3711
|
steps: M.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
3665
3712
|
active: P + 1,
|
|
3666
3713
|
style: { marginBottom: 8 }
|
|
@@ -3674,9 +3721,9 @@ function Nr({ style: e, action: t, method: n, name: r, enctype: i, formSlug: a,
|
|
|
3674
3721
|
},
|
|
3675
3722
|
children: M[P].section.help
|
|
3676
3723
|
}),
|
|
3677
|
-
F.map((e) => /* @__PURE__ */ h(
|
|
3724
|
+
F.map((e) => /* @__PURE__ */ h(Fr, {
|
|
3678
3725
|
field: e,
|
|
3679
|
-
value: T[
|
|
3726
|
+
value: T[Pr(e)],
|
|
3680
3727
|
values: T,
|
|
3681
3728
|
onChange: R,
|
|
3682
3729
|
inert: f
|
|
@@ -3751,10 +3798,10 @@ function Nr({ style: e, action: t, method: n, name: r, enctype: i, formSlug: a,
|
|
|
3751
3798
|
]
|
|
3752
3799
|
});
|
|
3753
3800
|
}
|
|
3754
|
-
var
|
|
3801
|
+
var Lr = null, Rr = null, zr = (e) => {
|
|
3755
3802
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
3756
|
-
if (
|
|
3757
|
-
if (
|
|
3803
|
+
if (Lr && Rr === t) return Lr;
|
|
3804
|
+
if (Lr && typeof window < "u") {
|
|
3758
3805
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
3759
3806
|
delete window[e];
|
|
3760
3807
|
} catch {
|
|
@@ -3762,22 +3809,22 @@ var Pr = null, Fr = null, Ir = (e) => {
|
|
|
3762
3809
|
}
|
|
3763
3810
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
3764
3811
|
}
|
|
3765
|
-
return
|
|
3812
|
+
return Rr = t, Lr = new Promise((e) => {
|
|
3766
3813
|
if (typeof window > "u") return;
|
|
3767
3814
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
3768
3815
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
3769
3816
|
let n = document.createElement("script");
|
|
3770
3817
|
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
3771
|
-
}),
|
|
3818
|
+
}), Lr;
|
|
3772
3819
|
};
|
|
3773
|
-
function
|
|
3820
|
+
function Br({ siteKey: e, theme: t, size: n, hl: r, style: i, nodeRef: a, inert: c, onChange: l }) {
|
|
3774
3821
|
let d = o(Y), f = d?.settings && typeof d.settings == "object" ? d.settings["google.recaptchaKey"] : "", p = typeof e == "string" && e.trim() || (typeof f == "string" ? f.trim() : ""), m = u(null), _ = u(l);
|
|
3775
3822
|
if (_.current = l, s(() => {
|
|
3776
3823
|
if (c || !p || !m.current) return;
|
|
3777
3824
|
let e = !0, i = (t) => {
|
|
3778
3825
|
e && typeof _.current == "function" && _.current(t);
|
|
3779
3826
|
};
|
|
3780
|
-
return
|
|
3827
|
+
return zr(r).then((r) => {
|
|
3781
3828
|
if (!(!e || !m.current || !r?.render)) {
|
|
3782
3829
|
m.current.innerHTML = "", i("");
|
|
3783
3830
|
try {
|
|
@@ -3859,17 +3906,17 @@ function Lr({ siteKey: e, theme: t, size: n, hl: r, style: i, nodeRef: a, inert:
|
|
|
3859
3906
|
children: /* @__PURE__ */ h("div", { ref: m })
|
|
3860
3907
|
}) : null;
|
|
3861
3908
|
}
|
|
3862
|
-
function
|
|
3909
|
+
function Vr({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
3863
3910
|
return /* @__PURE__ */ h("label", {
|
|
3864
3911
|
ref: r,
|
|
3865
3912
|
style: {
|
|
3866
|
-
...
|
|
3913
|
+
...Er,
|
|
3867
3914
|
...U(n)
|
|
3868
3915
|
},
|
|
3869
3916
|
children: vn(t, e, i)
|
|
3870
3917
|
});
|
|
3871
3918
|
}
|
|
3872
|
-
function
|
|
3919
|
+
function Hr({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
3873
3920
|
return /* @__PURE__ */ h("input", {
|
|
3874
3921
|
ref: a,
|
|
3875
3922
|
type: e,
|
|
@@ -3880,10 +3927,10 @@ function zr({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
3880
3927
|
...Z,
|
|
3881
3928
|
...U(i)
|
|
3882
3929
|
},
|
|
3883
|
-
...
|
|
3930
|
+
...Or(o)
|
|
3884
3931
|
});
|
|
3885
3932
|
}
|
|
3886
|
-
function
|
|
3933
|
+
function Ur({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
3887
3934
|
return /* @__PURE__ */ h("textarea", {
|
|
3888
3935
|
ref: a,
|
|
3889
3936
|
name: e || void 0,
|
|
@@ -3895,14 +3942,14 @@ function Br({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
3895
3942
|
resize: "vertical",
|
|
3896
3943
|
...U(i)
|
|
3897
3944
|
},
|
|
3898
|
-
...
|
|
3945
|
+
...Or(o)
|
|
3899
3946
|
});
|
|
3900
3947
|
}
|
|
3901
|
-
function
|
|
3948
|
+
function Wr({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
3902
3949
|
return /* @__PURE__ */ g("label", {
|
|
3903
3950
|
ref: o,
|
|
3904
3951
|
style: {
|
|
3905
|
-
...
|
|
3952
|
+
...Dr,
|
|
3906
3953
|
...U(a)
|
|
3907
3954
|
},
|
|
3908
3955
|
children: [/* @__PURE__ */ h("input", {
|
|
@@ -3920,7 +3967,7 @@ function Vr({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
3920
3967
|
}), t]
|
|
3921
3968
|
});
|
|
3922
3969
|
}
|
|
3923
|
-
function
|
|
3970
|
+
function Gr({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
3924
3971
|
return /* @__PURE__ */ g("select", {
|
|
3925
3972
|
ref: a,
|
|
3926
3973
|
name: e || void 0,
|
|
@@ -3943,7 +3990,7 @@ function Hr({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
3943
3990
|
}, t))]
|
|
3944
3991
|
});
|
|
3945
3992
|
}
|
|
3946
|
-
function
|
|
3993
|
+
function Kr({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
3947
3994
|
let [s, c] = d(null);
|
|
3948
3995
|
return /* @__PURE__ */ g("label", {
|
|
3949
3996
|
ref: a,
|
|
@@ -3976,7 +4023,7 @@ function Ur({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
3976
4023
|
]
|
|
3977
4024
|
});
|
|
3978
4025
|
}
|
|
3979
|
-
function
|
|
4026
|
+
function qr({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
3980
4027
|
return /* @__PURE__ */ h("button", {
|
|
3981
4028
|
ref: n,
|
|
3982
4029
|
type: r ? "button" : "submit",
|
|
@@ -3996,7 +4043,7 @@ function Wr({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
3996
4043
|
children: e
|
|
3997
4044
|
});
|
|
3998
4045
|
}
|
|
3999
|
-
function
|
|
4046
|
+
function Jr({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
4000
4047
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
4001
4048
|
return /* @__PURE__ */ h("div", {
|
|
4002
4049
|
ref: r,
|
|
@@ -4013,12 +4060,12 @@ function Gr({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
4013
4060
|
}, t))
|
|
4014
4061
|
});
|
|
4015
4062
|
}
|
|
4016
|
-
function
|
|
4063
|
+
function Yr(e, t) {
|
|
4017
4064
|
if (e === "" || e == null) return t;
|
|
4018
4065
|
let n = Number(e);
|
|
4019
4066
|
return Number.isFinite(n) && n >= 0 ? n : t;
|
|
4020
4067
|
}
|
|
4021
|
-
function
|
|
4068
|
+
function Xr({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: i, titleField: a = "name", textField: c, custom: l, templateId: u, renderTemplate: f, paged: p, filters: m, parentField: _, topLevel: v, childrenOf: y, gap: b, style: x, nodeRef: S }) {
|
|
4022
4069
|
let { tenant: C, apiUrl: w, locale: T } = o(Y), E = o(zt), D = o(Ft), O = o(Bt), k = y ? null : e, A = !!_ && !y, [, j] = d(0);
|
|
4023
4070
|
s(() => {
|
|
4024
4071
|
if (typeof window > "u") return;
|
|
@@ -4059,11 +4106,11 @@ function qr({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
4059
4106
|
let z = Math.max(1, Number(t) || 6), B = y ? O?.all ?? [] : F ?? L ?? [], V = y ? O?.parentField : _, H = y ? O?.collection : k, ee = y ? Ht(B, V, O?.entry) : A && v ? B.filter((e) => Vt(e, _).length === 0) : B, W = p && (F || y || A || k.startsWith("api:")) ? ee.slice((I - 1) * z, I * z) : ee.slice(0, z), te = Math.min(Math.max(Number(r) || 3, 1), 6), ne = n === "list" ? {
|
|
4060
4107
|
display: "flex",
|
|
4061
4108
|
flexDirection: "column",
|
|
4062
|
-
gap:
|
|
4109
|
+
gap: Yr(b, 20)
|
|
4063
4110
|
} : {
|
|
4064
4111
|
display: "grid",
|
|
4065
4112
|
gridTemplateColumns: `repeat(${te}, minmax(0, 1fr))`,
|
|
4066
|
-
gap:
|
|
4113
|
+
gap: Yr(b, 24)
|
|
4067
4114
|
}, G = f ?? (u && E?.render ? (e) => E.render(u, e) : null);
|
|
4068
4115
|
return l && G ? /* @__PURE__ */ h("div", {
|
|
4069
4116
|
ref: S,
|
|
@@ -4153,7 +4200,7 @@ function qr({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
4153
4200
|
})
|
|
4154
4201
|
});
|
|
4155
4202
|
}
|
|
4156
|
-
function
|
|
4203
|
+
function Zr({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
4157
4204
|
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : Lt(), s = {
|
|
4158
4205
|
height: 34,
|
|
4159
4206
|
padding: "0 12px",
|
|
@@ -4203,7 +4250,7 @@ function Jr({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
4203
4250
|
defaultValue: o[e.name] ?? "",
|
|
4204
4251
|
...X("select"),
|
|
4205
4252
|
style: s,
|
|
4206
|
-
...
|
|
4253
|
+
...Or(i),
|
|
4207
4254
|
children: [/* @__PURE__ */ h("option", {
|
|
4208
4255
|
value: "",
|
|
4209
4256
|
children: e.label || e.name
|
|
@@ -4219,7 +4266,7 @@ function Jr({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
4219
4266
|
defaultValue: o[e.name] ?? "",
|
|
4220
4267
|
...X("select"),
|
|
4221
4268
|
style: s,
|
|
4222
|
-
...
|
|
4269
|
+
...Or(i),
|
|
4223
4270
|
children: [
|
|
4224
4271
|
/* @__PURE__ */ h("option", {
|
|
4225
4272
|
value: "",
|
|
@@ -4241,7 +4288,7 @@ function Jr({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
4241
4288
|
placeholder: e.label || e.name,
|
|
4242
4289
|
...X("input"),
|
|
4243
4290
|
style: s,
|
|
4244
|
-
...
|
|
4291
|
+
...Or(i)
|
|
4245
4292
|
}, e.name)), /* @__PURE__ */ h("button", {
|
|
4246
4293
|
type: "submit",
|
|
4247
4294
|
...X("button"),
|
|
@@ -4255,12 +4302,12 @@ function Jr({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
4255
4302
|
fontWeight: 600,
|
|
4256
4303
|
cursor: i ? "default" : "pointer"
|
|
4257
4304
|
},
|
|
4258
|
-
...
|
|
4305
|
+
...Or(i),
|
|
4259
4306
|
children: t
|
|
4260
4307
|
})]
|
|
4261
4308
|
});
|
|
4262
4309
|
}
|
|
4263
|
-
function
|
|
4310
|
+
function Qr({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
4264
4311
|
return e.length ? /* @__PURE__ */ h("nav", {
|
|
4265
4312
|
ref: r,
|
|
4266
4313
|
"aria-label": "Breadcrumb",
|
|
@@ -4315,7 +4362,7 @@ function Yr({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
4315
4362
|
})
|
|
4316
4363
|
}) : null;
|
|
4317
4364
|
}
|
|
4318
|
-
function
|
|
4365
|
+
function $r({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", source: i, pageSize: a = 6, align: c, hideEmpty: l, inert: u, style: f, nodeRef: p }) {
|
|
4319
4366
|
let { tenant: m, apiUrl: _ } = o(Y), v = o(Ft), [y, b] = d(null), x = i ? Number(v?.[`${i}:total`]) : NaN;
|
|
4320
4367
|
s(() => {
|
|
4321
4368
|
if (!i || Number.isFinite(x)) return;
|
|
@@ -4403,15 +4450,15 @@ function Xr({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
4403
4450
|
]
|
|
4404
4451
|
});
|
|
4405
4452
|
}
|
|
4406
|
-
var
|
|
4453
|
+
var ei = "webim.page_mode", ti = () => {
|
|
4407
4454
|
if (typeof window > "u") return "auto";
|
|
4408
4455
|
try {
|
|
4409
|
-
let e = window.localStorage.getItem(
|
|
4456
|
+
let e = window.localStorage.getItem(ei);
|
|
4410
4457
|
return e === "light" || e === "dark" ? e : "auto";
|
|
4411
4458
|
} catch {
|
|
4412
4459
|
return "auto";
|
|
4413
4460
|
}
|
|
4414
|
-
},
|
|
4461
|
+
}, ni = (e) => {
|
|
4415
4462
|
let t = {
|
|
4416
4463
|
width: 16,
|
|
4417
4464
|
height: 16,
|
|
@@ -4443,13 +4490,13 @@ var Zr = "webim.page_mode", Qr = () => {
|
|
|
4443
4490
|
rx: "2"
|
|
4444
4491
|
}), /* @__PURE__ */ h("path", { d: "M8 21h8M12 17v4" })]
|
|
4445
4492
|
});
|
|
4446
|
-
},
|
|
4493
|
+
}, ri = {
|
|
4447
4494
|
light: "Light theme",
|
|
4448
4495
|
dark: "Dark theme",
|
|
4449
4496
|
auto: "Follow the device theme"
|
|
4450
4497
|
};
|
|
4451
|
-
function
|
|
4452
|
-
let [a, o] = d(i ? "auto" :
|
|
4498
|
+
function ii({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
4499
|
+
let [a, o] = d(i ? "auto" : ti), c = u(null), l = (e) => {
|
|
4453
4500
|
c.current = e, typeof r == "function" && r(e);
|
|
4454
4501
|
};
|
|
4455
4502
|
s(() => {
|
|
@@ -4457,7 +4504,7 @@ function ti({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
4457
4504
|
let e = c.current?.closest?.(".webim-page");
|
|
4458
4505
|
e && (a === "light" || a === "dark" ? e.setAttribute("data-webim-mode", a) : e.removeAttribute("data-webim-mode"));
|
|
4459
4506
|
try {
|
|
4460
|
-
a === "auto" ? window.localStorage.removeItem(
|
|
4507
|
+
a === "auto" ? window.localStorage.removeItem(ei) : window.localStorage.setItem(ei, a);
|
|
4461
4508
|
} catch {}
|
|
4462
4509
|
}, [a, i]);
|
|
4463
4510
|
let f = t === !1 ? ["light", "dark"] : [
|
|
@@ -4493,8 +4540,8 @@ function ti({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
4493
4540
|
children: f.map((e) => /* @__PURE__ */ h("button", {
|
|
4494
4541
|
...X("option", e === p && "option-active"),
|
|
4495
4542
|
type: "button",
|
|
4496
|
-
title:
|
|
4497
|
-
"aria-label":
|
|
4543
|
+
title: ri[e],
|
|
4544
|
+
"aria-label": ri[e],
|
|
4498
4545
|
"aria-pressed": e === p,
|
|
4499
4546
|
onClick: i ? void 0 : () => o(e),
|
|
4500
4547
|
style: {
|
|
@@ -4505,15 +4552,15 @@ function ti({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
4505
4552
|
background: e === p ? "var(--page-accent, #111827)" : "transparent",
|
|
4506
4553
|
opacity: e === p ? 1 : .7
|
|
4507
4554
|
},
|
|
4508
|
-
children:
|
|
4555
|
+
children: ni(e)
|
|
4509
4556
|
}, e))
|
|
4510
4557
|
});
|
|
4511
4558
|
let g = f[(f.indexOf(p) + 1) % f.length];
|
|
4512
4559
|
return /* @__PURE__ */ h("button", {
|
|
4513
4560
|
ref: l,
|
|
4514
4561
|
type: "button",
|
|
4515
|
-
title:
|
|
4516
|
-
"aria-label": `Theme: ${
|
|
4562
|
+
title: ri[p],
|
|
4563
|
+
"aria-label": `Theme: ${ri[p]} — switch to ${ri[g]}`,
|
|
4517
4564
|
onClick: i ? void 0 : () => o(g),
|
|
4518
4565
|
style: {
|
|
4519
4566
|
...m,
|
|
@@ -4522,10 +4569,10 @@ function ti({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
4522
4569
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
4523
4570
|
...U(n)
|
|
4524
4571
|
},
|
|
4525
|
-
children:
|
|
4572
|
+
children: ni(p)
|
|
4526
4573
|
});
|
|
4527
4574
|
}
|
|
4528
|
-
function
|
|
4575
|
+
function ai(e) {
|
|
4529
4576
|
let t = e?.parentElement;
|
|
4530
4577
|
for (; t && t !== document.body;) {
|
|
4531
4578
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -4534,7 +4581,7 @@ function ni(e) {
|
|
|
4534
4581
|
}
|
|
4535
4582
|
return window;
|
|
4536
4583
|
}
|
|
4537
|
-
var
|
|
4584
|
+
var oi = (e) => e === window ? window.scrollY : e.scrollTop, si = {
|
|
4538
4585
|
"bottom-right": (e) => ({
|
|
4539
4586
|
right: e,
|
|
4540
4587
|
bottom: e
|
|
@@ -4548,11 +4595,11 @@ var ri = (e) => e === window ? window.scrollY : e.scrollTop, ii = {
|
|
|
4548
4595
|
bottom: e,
|
|
4549
4596
|
transform: "translateX(-50%)"
|
|
4550
4597
|
})
|
|
4551
|
-
},
|
|
4598
|
+
}, ci = {
|
|
4552
4599
|
linear: (e) => e,
|
|
4553
4600
|
out: (e) => 1 - (1 - e) ** 3,
|
|
4554
4601
|
inout: (e) => e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2
|
|
4555
|
-
},
|
|
4602
|
+
}, li = (e) => {
|
|
4556
4603
|
let t = e.getBoundingClientRect(), n = e.parentElement;
|
|
4557
4604
|
for (; n && n !== document.body;) {
|
|
4558
4605
|
let e = getComputedStyle(n);
|
|
@@ -4560,12 +4607,12 @@ var ri = (e) => e === window ? window.scrollY : e.scrollTop, ii = {
|
|
|
4560
4607
|
n = n.parentElement;
|
|
4561
4608
|
}
|
|
4562
4609
|
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);
|
|
4563
|
-
},
|
|
4610
|
+
}, ui = (e, t) => {
|
|
4564
4611
|
let n = typeof e == "number" ? e : parseFloat(e);
|
|
4565
4612
|
return Number.isFinite(n) ? n : t;
|
|
4566
4613
|
};
|
|
4567
|
-
function
|
|
4568
|
-
let i = Math.min(Math.max(Math.round(
|
|
4614
|
+
function di(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
|
|
4615
|
+
let i = Math.min(Math.max(Math.round(ui(n, 0)), 0), 6);
|
|
4569
4616
|
try {
|
|
4570
4617
|
return new Intl.NumberFormat(t || void 0, {
|
|
4571
4618
|
minimumFractionDigits: i,
|
|
@@ -4576,8 +4623,8 @@ function ci(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
|
|
|
4576
4623
|
return e.toFixed(i);
|
|
4577
4624
|
}
|
|
4578
4625
|
}
|
|
4579
|
-
function
|
|
4580
|
-
let { locale: C } = o(Y), w = Math.max(
|
|
4626
|
+
function fi({ from: e, to: t, duration: n, delay: r, decimals: i, prefix: a, suffix: c, separator: l, easing: f, trigger: p, offset: m, once: _, label: v, align: y, style: b, nodeRef: x, inert: S }) {
|
|
4627
|
+
let { locale: C } = o(Y), w = Math.max(ui(m, 0), 0), T = ui(e, 0), E = ui(t, 100), [D, O] = d(E), k = u(null), [A, j] = d(!1);
|
|
4581
4628
|
return s(() => {
|
|
4582
4629
|
let e = k.current;
|
|
4583
4630
|
if (S || !A || !e) {
|
|
@@ -4585,7 +4632,7 @@ function li({ from: e, to: t, duration: n, delay: r, decimals: i, prefix: a, suf
|
|
|
4585
4632
|
return;
|
|
4586
4633
|
}
|
|
4587
4634
|
O(T);
|
|
4588
|
-
let t = Math.max(
|
|
4635
|
+
let t = Math.max(ui(n, 2e3), 0), i = Math.max(ui(r, 0), 0), a = ci[f] || ci.out, o = typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, s = 0, c = 0, l = !1, u = () => {
|
|
4589
4636
|
if (cancelAnimationFrame(s), clearTimeout(c), o || t === 0) {
|
|
4590
4637
|
O(E);
|
|
4591
4638
|
return;
|
|
@@ -4605,7 +4652,7 @@ function li({ from: e, to: t, duration: n, delay: r, decimals: i, prefix: a, suf
|
|
|
4605
4652
|
let t = e.some((e) => e.isIntersecting);
|
|
4606
4653
|
t && (!l || _ === !1) ? (l = !0, u()) : !t && _ === !1 && (cancelAnimationFrame(s), clearTimeout(c), O(T));
|
|
4607
4654
|
}, {
|
|
4608
|
-
rootMargin: `0px 0px -${Math.min(w, Math.floor(
|
|
4655
|
+
rootMargin: `0px 0px -${Math.min(w, Math.floor(li(e)))}px 0px`,
|
|
4609
4656
|
threshold: w > 0 ? 0 : .3
|
|
4610
4657
|
});
|
|
4611
4658
|
return d.observe(e), () => {
|
|
@@ -4646,7 +4693,7 @@ function li({ from: e, to: t, duration: n, delay: r, decimals: i, prefix: a, suf
|
|
|
4646
4693
|
},
|
|
4647
4694
|
children: [
|
|
4648
4695
|
a || "",
|
|
4649
|
-
|
|
4696
|
+
di(D, {
|
|
4650
4697
|
locale: C,
|
|
4651
4698
|
decimals: i,
|
|
4652
4699
|
separator: l
|
|
@@ -4665,7 +4712,7 @@ function li({ from: e, to: t, duration: n, delay: r, decimals: i, prefix: a, suf
|
|
|
4665
4712
|
}) : null]
|
|
4666
4713
|
});
|
|
4667
4714
|
}
|
|
4668
|
-
function
|
|
4715
|
+
function pi({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth: a, bg: o, fg: c, style: l, nodeRef: u, inert: f, frame: p, builder: m }) {
|
|
4669
4716
|
let [_, v] = d(!!f), [y, b] = d(null), x = (e) => {
|
|
4670
4717
|
b(e), typeof u == "function" && u(e);
|
|
4671
4718
|
};
|
|
@@ -4676,8 +4723,8 @@ function ui({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
4676
4723
|
}
|
|
4677
4724
|
if (!y) return;
|
|
4678
4725
|
let e = Number(i) >= 0 ? Number(i) : 300, t = () => {
|
|
4679
|
-
let t =
|
|
4680
|
-
v(n ||
|
|
4726
|
+
let t = ai(y), n = m && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
4727
|
+
v(n || oi(t) > e);
|
|
4681
4728
|
};
|
|
4682
4729
|
return t(), document.addEventListener("scroll", t, {
|
|
4683
4730
|
capture: !0,
|
|
@@ -4691,7 +4738,7 @@ function ui({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
4691
4738
|
]);
|
|
4692
4739
|
let S = () => {
|
|
4693
4740
|
if (f) return;
|
|
4694
|
-
let e =
|
|
4741
|
+
let e = ai(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = a === !1 || t ? "auto" : "smooth";
|
|
4695
4742
|
e === window ? window.scrollTo({
|
|
4696
4743
|
top: 0,
|
|
4697
4744
|
behavior: n
|
|
@@ -4699,7 +4746,7 @@ function ui({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
4699
4746
|
top: 0,
|
|
4700
4747
|
behavior: n
|
|
4701
4748
|
});
|
|
4702
|
-
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E =
|
|
4749
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = si[n] ? n : "bottom-right", D = p ? {
|
|
4703
4750
|
position: "fixed",
|
|
4704
4751
|
zIndex: 5,
|
|
4705
4752
|
bottom: (p.bottom ?? 0) + C,
|
|
@@ -4712,7 +4759,7 @@ function ui({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
4712
4759
|
} : {
|
|
4713
4760
|
position: "fixed",
|
|
4714
4761
|
zIndex: 2147482e3,
|
|
4715
|
-
...
|
|
4762
|
+
...si[E](C)
|
|
4716
4763
|
};
|
|
4717
4764
|
return /* @__PURE__ */ g("button", {
|
|
4718
4765
|
ref: x,
|
|
@@ -4767,7 +4814,7 @@ function ui({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
4767
4814
|
}) : null]
|
|
4768
4815
|
});
|
|
4769
4816
|
}
|
|
4770
|
-
var
|
|
4817
|
+
var mi = {
|
|
4771
4818
|
facebook: {
|
|
4772
4819
|
label: "Facebook",
|
|
4773
4820
|
color: "#1877f2",
|
|
@@ -4834,8 +4881,8 @@ var di = {
|
|
|
4834
4881
|
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"
|
|
4835
4882
|
}
|
|
4836
4883
|
};
|
|
4837
|
-
function
|
|
4838
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
4884
|
+
function hi({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
4885
|
+
let l = Array.isArray(e) ? e.filter((e) => e && mi[e.network]) : [];
|
|
4839
4886
|
if (!l.length) return null;
|
|
4840
4887
|
let u = Math.min(Math.max(Number(r) || 18, 10), 64), d = Math.round(u * 1.9), f = Number.isFinite(Number(i)) ? Number(i) : 10, p = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, m = c ? (e) => e.preventDefault() : void 0;
|
|
4841
4888
|
return /* @__PURE__ */ h("div", {
|
|
@@ -4848,7 +4895,7 @@ function fi({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
4848
4895
|
...U(o)
|
|
4849
4896
|
},
|
|
4850
4897
|
children: l.map((e, r) => {
|
|
4851
|
-
let i =
|
|
4898
|
+
let i = mi[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : p(i);
|
|
4852
4899
|
return /* @__PURE__ */ h("a", {
|
|
4853
4900
|
...X("link", /^[a-z]+$/.test(e.network ?? "") && `link-${e.network}`),
|
|
4854
4901
|
href: e.url || "#",
|
|
@@ -4884,7 +4931,7 @@ function fi({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
4884
4931
|
})
|
|
4885
4932
|
});
|
|
4886
4933
|
}
|
|
4887
|
-
function
|
|
4934
|
+
function gi({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
4888
4935
|
if (!t.length) return null;
|
|
4889
4936
|
let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
|
|
4890
4937
|
width: 32,
|
|
@@ -4967,7 +5014,7 @@ function pi({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
4967
5014
|
})
|
|
4968
5015
|
});
|
|
4969
5016
|
}
|
|
4970
|
-
var
|
|
5017
|
+
var _i = {
|
|
4971
5018
|
small: {
|
|
4972
5019
|
w: 132,
|
|
4973
5020
|
h: 46,
|
|
@@ -4989,21 +5036,21 @@ var mi = {
|
|
|
4989
5036
|
title: 12.5,
|
|
4990
5037
|
avatar: 46
|
|
4991
5038
|
}
|
|
4992
|
-
},
|
|
4993
|
-
|
|
4994
|
-
var
|
|
5039
|
+
}, vi = (e) => _i[e] ?? _i.medium;
|
|
5040
|
+
_i.medium.w, _i.medium.h;
|
|
5041
|
+
var yi = (e) => String(e?.group ?? "").trim(), bi = (e) => {
|
|
4995
5042
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
4996
5043
|
return e.forEach((e, r) => {
|
|
4997
|
-
let i =
|
|
5044
|
+
let i = yi(e) || `#${r}`;
|
|
4998
5045
|
n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
|
|
4999
5046
|
}), t.flatMap((e) => n.get(e));
|
|
5000
5047
|
};
|
|
5001
|
-
function
|
|
5002
|
-
let i =
|
|
5048
|
+
function xi(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
|
|
5049
|
+
let i = vi(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 = [];
|
|
5003
5050
|
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);
|
|
5004
|
-
d =
|
|
5005
|
-
for (let [e, t] of u) u.set(e,
|
|
5006
|
-
let f = (e, t) => o + (
|
|
5051
|
+
d = bi(d);
|
|
5052
|
+
for (let [e, t] of u) u.set(e, bi(t));
|
|
5053
|
+
let f = (e, t) => o + (yi(e) !== yi(t) && (yi(e) || yi(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
|
|
5007
5054
|
if (t.has(e.id)) return 0;
|
|
5008
5055
|
t.add(e.id);
|
|
5009
5056
|
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);
|
|
@@ -5019,7 +5066,7 @@ function vi(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
5019
5066
|
x: m,
|
|
5020
5067
|
y: b
|
|
5021
5068
|
});
|
|
5022
|
-
let x =
|
|
5069
|
+
let x = yi(e);
|
|
5023
5070
|
if (x) {
|
|
5024
5071
|
let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
|
|
5025
5072
|
_.has(t) || _.set(t, {
|
|
@@ -5093,18 +5140,18 @@ function vi(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
5093
5140
|
horizontal: n
|
|
5094
5141
|
};
|
|
5095
5142
|
}
|
|
5096
|
-
var
|
|
5143
|
+
var Si = (e, t) => {
|
|
5097
5144
|
let n = String(e ?? "");
|
|
5098
5145
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
5099
|
-
},
|
|
5146
|
+
}, Ci = (e) => {
|
|
5100
5147
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
5101
5148
|
if (!t) return "#ffffff";
|
|
5102
5149
|
let n = t[1];
|
|
5103
5150
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
5104
5151
|
let r = parseInt(n, 16);
|
|
5105
5152
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
5106
|
-
},
|
|
5107
|
-
function
|
|
5153
|
+
}, wi = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
5154
|
+
function Ti(e, t = {}) {
|
|
5108
5155
|
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 ? "" : Yt(e);
|
|
5109
5156
|
return n.map((e) => {
|
|
5110
5157
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
@@ -5120,11 +5167,11 @@ function Si(e, t = {}) {
|
|
|
5120
5167
|
};
|
|
5121
5168
|
});
|
|
5122
5169
|
}
|
|
5123
|
-
var
|
|
5170
|
+
var Ei = {
|
|
5124
5171
|
size: 36,
|
|
5125
5172
|
pad: 10
|
|
5126
5173
|
};
|
|
5127
|
-
function
|
|
5174
|
+
function Di({ node: e, onClose: t }) {
|
|
5128
5175
|
return s(() => {
|
|
5129
5176
|
let e = (e) => e.key === "Escape" && t();
|
|
5130
5177
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -5245,7 +5292,7 @@ function wi({ node: e, onClose: t }) {
|
|
|
5245
5292
|
})
|
|
5246
5293
|
});
|
|
5247
5294
|
}
|
|
5248
|
-
function
|
|
5295
|
+
function Oi({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: i, parentField: a, cvField: l, hrefField: u, groupField: f, groupTitles: p = "top", groupBg: _ = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
|
|
5249
5296
|
let C = c(), [w, T] = d(null), { tenant: E, apiUrl: D } = o(Y), O = o(Ft)?.[t], [k, A] = d(null);
|
|
5250
5297
|
s(() => {
|
|
5251
5298
|
if (!t || O) return;
|
|
@@ -5262,7 +5309,7 @@ function Ti({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
5262
5309
|
D,
|
|
5263
5310
|
O
|
|
5264
5311
|
]);
|
|
5265
|
-
let j = t ?
|
|
5312
|
+
let j = t ? Ti(O ?? k ?? [], {
|
|
5266
5313
|
nameField: n,
|
|
5267
5314
|
titleField: r,
|
|
5268
5315
|
photoField: i,
|
|
@@ -5270,7 +5317,7 @@ function Ti({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
5270
5317
|
cvField: l,
|
|
5271
5318
|
hrefField: u,
|
|
5272
5319
|
groupField: f
|
|
5273
|
-
}) : e, M =
|
|
5320
|
+
}) : e, M = vi(v), { boxes: N, links: P, groups: F, width: I, height: L } = xi(j, {
|
|
5274
5321
|
size: v,
|
|
5275
5322
|
horizontal: y,
|
|
5276
5323
|
groupTitles: p
|
|
@@ -5328,8 +5375,8 @@ function Ti({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
5328
5375
|
fontSize: M.title + 1,
|
|
5329
5376
|
fontWeight: "600",
|
|
5330
5377
|
opacity: "0.55",
|
|
5331
|
-
fill: r ?
|
|
5332
|
-
children:
|
|
5378
|
+
fill: r ? Ci(e.color || _) : "var(--page-text, #111827)",
|
|
5379
|
+
children: Si(e.title, Math.floor(e.width / 7))
|
|
5333
5380
|
})] }, `group-${t}`);
|
|
5334
5381
|
}),
|
|
5335
5382
|
P.map((e, t) => /* @__PURE__ */ h("path", {
|
|
@@ -5339,7 +5386,7 @@ function Ti({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
5339
5386
|
strokeWidth: "1.5"
|
|
5340
5387
|
}, t)),
|
|
5341
5388
|
N.map(({ node: e, x: t, y: n }) => {
|
|
5342
|
-
let r = R.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 ?
|
|
5389
|
+
let r = R.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 ? Ci(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Ci(e.color2) : s, l = S && (wi(e) || e.href), u = () => wi(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), d = e.photo ? t + Ei.pad + M.avatar + 8 : t + M.w / 2, f = e.photo ? "start" : "middle", p = 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);
|
|
5343
5390
|
return /* @__PURE__ */ g("g", {
|
|
5344
5391
|
onClick: l ? u : void 0,
|
|
5345
5392
|
style: l ? { cursor: "pointer" } : void 0,
|
|
@@ -5403,13 +5450,13 @@ function Ti({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
5403
5450
|
e.photo && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("clipPath", {
|
|
5404
5451
|
id: `${C}-${e.id}`,
|
|
5405
5452
|
children: /* @__PURE__ */ h("circle", {
|
|
5406
|
-
cx: t +
|
|
5453
|
+
cx: t + Ei.pad + M.avatar / 2,
|
|
5407
5454
|
cy: n + M.h / 2,
|
|
5408
5455
|
r: M.avatar / 2
|
|
5409
5456
|
})
|
|
5410
5457
|
}), /* @__PURE__ */ h("image", {
|
|
5411
5458
|
href: e.photo,
|
|
5412
|
-
x: t +
|
|
5459
|
+
x: t + Ei.pad,
|
|
5413
5460
|
y: n + (M.h - M.avatar) / 2,
|
|
5414
5461
|
width: M.avatar,
|
|
5415
5462
|
height: M.avatar,
|
|
@@ -5423,7 +5470,7 @@ function Ti({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
5423
5470
|
fontSize: M.title,
|
|
5424
5471
|
fontWeight: "600",
|
|
5425
5472
|
fill: s,
|
|
5426
|
-
children:
|
|
5473
|
+
children: Si(e.title, p + 4)
|
|
5427
5474
|
}), e.name && /* @__PURE__ */ h("text", {
|
|
5428
5475
|
x: d,
|
|
5429
5476
|
y: n + _ + _ / 2 + M.name * .35,
|
|
@@ -5431,7 +5478,7 @@ function Ti({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
5431
5478
|
fontSize: M.name,
|
|
5432
5479
|
fontWeight: "600",
|
|
5433
5480
|
fill: c,
|
|
5434
|
-
children:
|
|
5481
|
+
children: Si(e.name, p)
|
|
5435
5482
|
})] }) : /* @__PURE__ */ g(m, { children: [v[0] && /* @__PURE__ */ h("text", {
|
|
5436
5483
|
x: d,
|
|
5437
5484
|
y: n + (v[1] ? M.h * .43 : M.h * .57),
|
|
@@ -5439,7 +5486,7 @@ function Ti({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
5439
5486
|
fontSize: M.name,
|
|
5440
5487
|
fontWeight: "600",
|
|
5441
5488
|
fill: s,
|
|
5442
|
-
children:
|
|
5489
|
+
children: Si(v[0], p)
|
|
5443
5490
|
}), v[1] && /* @__PURE__ */ h("text", {
|
|
5444
5491
|
x: d,
|
|
5445
5492
|
y: n + M.h * .73,
|
|
@@ -5447,19 +5494,19 @@ function Ti({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
5447
5494
|
fontSize: M.title,
|
|
5448
5495
|
opacity: "0.7",
|
|
5449
5496
|
fill: s,
|
|
5450
|
-
children:
|
|
5497
|
+
children: Si(v[1], p + 4)
|
|
5451
5498
|
})] })
|
|
5452
5499
|
]
|
|
5453
5500
|
}, e.id);
|
|
5454
5501
|
})
|
|
5455
5502
|
]
|
|
5456
|
-
}), w && /* @__PURE__ */ h(
|
|
5503
|
+
}), w && /* @__PURE__ */ h(Di, {
|
|
5457
5504
|
node: w,
|
|
5458
5505
|
onClose: () => T(null)
|
|
5459
5506
|
})]
|
|
5460
5507
|
});
|
|
5461
5508
|
}
|
|
5462
|
-
function
|
|
5509
|
+
function ki({ value: e, onCommit: t, style: n, hint: r }) {
|
|
5463
5510
|
let [i, a] = d(!1), o = u(null);
|
|
5464
5511
|
return s(() => {
|
|
5465
5512
|
if (!i || !o.current) return;
|
|
@@ -5489,7 +5536,7 @@ function Ei({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
5489
5536
|
children: e ?? ""
|
|
5490
5537
|
});
|
|
5491
5538
|
}
|
|
5492
|
-
var
|
|
5539
|
+
var Ai = 360, ji = "\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", Mi = (e, t) => e && t ? `cell-${e}-${t}` : "", Ni = (e) => {
|
|
5493
5540
|
if (!e || typeof e != "object") return e ?? "";
|
|
5494
5541
|
let t = String(e.text ?? "");
|
|
5495
5542
|
return typeof e.href == "string" && e.href ? /* @__PURE__ */ h("a", {
|
|
@@ -5500,7 +5547,7 @@ var Di = 360, Oi = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
|
|
|
5500
5547
|
children: t
|
|
5501
5548
|
}) : t;
|
|
5502
5549
|
};
|
|
5503
|
-
function
|
|
5550
|
+
function Pi({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], colKeys: i = [], heights: a = [], spans: c, linked: l, source: f, limit: p = 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 }) {
|
|
5504
5551
|
let P = u(null), F = u(null), [I, L] = d(null), [R, z] = d(null), B = (e, t) => () => L({
|
|
5505
5552
|
r: e,
|
|
5506
5553
|
c: t
|
|
@@ -5514,7 +5561,7 @@ function ji({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
5514
5561
|
}
|
|
5515
5562
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
5516
5563
|
top: r.bottom - n.top + 4,
|
|
5517
|
-
left: Math.max(0, Math.min(r.left - n.left, n.width -
|
|
5564
|
+
left: Math.max(0, Math.min(r.left - n.left, n.width - Ai))
|
|
5518
5565
|
};
|
|
5519
5566
|
(R?.top !== i.top || R?.left !== i.left) && z(i);
|
|
5520
5567
|
}), s(() => {
|
|
@@ -5570,7 +5617,7 @@ function ji({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
5570
5617
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
5571
5618
|
}, xe = /* @__PURE__ */ new Set();
|
|
5572
5619
|
c && ie.forEach((t, n) => e.forEach((e, t) => {
|
|
5573
|
-
let a = c[
|
|
5620
|
+
let a = c[Mi(r[n], i[t])];
|
|
5574
5621
|
if (!a) return;
|
|
5575
5622
|
let o = Math.max(1, Number(a.c) || 1), s = Math.max(1, Number(a.r) || 1);
|
|
5576
5623
|
for (let e = 0; e < s; e++) for (let r = 0; r < o; r++) (e || r) && xe.add(`${n + e},${t + r}`);
|
|
@@ -5593,7 +5640,7 @@ function ji({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
5593
5640
|
},
|
|
5594
5641
|
onClick: n,
|
|
5595
5642
|
children: e
|
|
5596
|
-
}, t), q = I && I.r < ie.length && I.c < e.length ? I : null, J = (e, t) => N?.labels?.[e] ?? t, we = q ? c?.[
|
|
5643
|
+
}, t), q = I && I.r < ie.length && I.c < e.length ? I : null, J = (e, t) => N?.labels?.[e] ?? t, we = q ? c?.[Mi(r[q.r], i[q.c])] : null, Te = Math.max(1, Number(we?.c) || 1), Ee = Math.max(1, Number(we?.r) || 1);
|
|
5597
5644
|
return /* @__PURE__ */ g("div", {
|
|
5598
5645
|
ref: (e) => {
|
|
5599
5646
|
F.current = e, typeof M == "function" && M(e);
|
|
@@ -5604,7 +5651,7 @@ function ji({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
5604
5651
|
...ve
|
|
5605
5652
|
},
|
|
5606
5653
|
children: [
|
|
5607
|
-
N && /* @__PURE__ */ h("style", { children:
|
|
5654
|
+
N && /* @__PURE__ */ h("style", { children: ji }),
|
|
5608
5655
|
N && q && R && /* @__PURE__ */ g("div", {
|
|
5609
5656
|
className: "wb-tedit-bar",
|
|
5610
5657
|
style: {
|
|
@@ -5674,7 +5721,7 @@ function ji({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
5674
5721
|
} : N ? { position: "relative" } : null,
|
|
5675
5722
|
...le
|
|
5676
5723
|
},
|
|
5677
|
-
children: N ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(
|
|
5724
|
+
children: N ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(ki, {
|
|
5678
5725
|
value: t.label ?? t,
|
|
5679
5726
|
onCommit: (e) => N.header(n, e),
|
|
5680
5727
|
hint: J("editCell", "Double-click to edit"),
|
|
@@ -5705,7 +5752,7 @@ function ji({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
5705
5752
|
},
|
|
5706
5753
|
children: e.map((e, a) => {
|
|
5707
5754
|
if (xe.has(`${n},${a}`)) return null;
|
|
5708
|
-
let o =
|
|
5755
|
+
let o = Mi(r[n], i[a]), s = l?.[o], u = c?.[o], d = Math.max(1, Number(u?.c) || 1), f = Math.max(1, Number(u?.r) || 1);
|
|
5709
5756
|
return /* @__PURE__ */ g("td", {
|
|
5710
5757
|
...X("cell"),
|
|
5711
5758
|
className: N ? `wb-tedit-cell${I?.r === n && I?.c === a ? " wb-tedit-cellon" : ""}` : void 0,
|
|
@@ -5719,7 +5766,7 @@ function ji({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
5719
5766
|
...N ? { position: "relative" } : null,
|
|
5720
5767
|
...le
|
|
5721
5768
|
},
|
|
5722
|
-
children: [s ??
|
|
5769
|
+
children: [s ?? Ni(t?.[a]), N && ye && /* @__PURE__ */ h("span", {
|
|
5723
5770
|
className: "wb-tedit-rowgrip",
|
|
5724
5771
|
title: J("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
5725
5772
|
onPointerDown: Se(n),
|
|
@@ -5734,7 +5781,7 @@ function ji({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
5734
5781
|
]
|
|
5735
5782
|
});
|
|
5736
5783
|
}
|
|
5737
|
-
var
|
|
5784
|
+
var Fi = {
|
|
5738
5785
|
small: {
|
|
5739
5786
|
cell: 62,
|
|
5740
5787
|
font: 10.5,
|
|
@@ -5759,8 +5806,8 @@ var Mi = {
|
|
|
5759
5806
|
pad: 8,
|
|
5760
5807
|
gap: 4
|
|
5761
5808
|
}
|
|
5762
|
-
},
|
|
5763
|
-
function
|
|
5809
|
+
}, Ii = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Li = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Ri = 366;
|
|
5810
|
+
function zi(e, t = {}) {
|
|
5764
5811
|
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 ? "" : Yt(e), a = (e) => {
|
|
5765
5812
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
5766
5813
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
@@ -5777,7 +5824,7 @@ function Ii(e, t = {}) {
|
|
|
5777
5824
|
} : null;
|
|
5778
5825
|
}).filter(Boolean);
|
|
5779
5826
|
}
|
|
5780
|
-
function
|
|
5827
|
+
function Bi(e) {
|
|
5781
5828
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
5782
5829
|
let n = e?.start ? new Date(e.start) : null;
|
|
5783
5830
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -5792,19 +5839,19 @@ function Li(e) {
|
|
|
5792
5839
|
};
|
|
5793
5840
|
}).filter(Boolean);
|
|
5794
5841
|
}
|
|
5795
|
-
function
|
|
5842
|
+
function Vi(e) {
|
|
5796
5843
|
let t = /* @__PURE__ */ new Map();
|
|
5797
5844
|
for (let n of e) {
|
|
5798
|
-
let e =
|
|
5845
|
+
let e = Li(n.start), r = n.end ? Li(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Ri);
|
|
5799
5846
|
for (let r = 0; r <= i; r += 1) {
|
|
5800
|
-
let i =
|
|
5847
|
+
let i = Ii(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
5801
5848
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
5802
5849
|
}
|
|
5803
5850
|
}
|
|
5804
5851
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
5805
5852
|
return t;
|
|
5806
5853
|
}
|
|
5807
|
-
function
|
|
5854
|
+
function Hi({ events: e = [], source: t = "", titleField: n = "", startField: r = "", endField: i = "", hrefField: a = "", colorField: c = "", variant: l = "month", size: u = "medium", accent: f = "", eventBg: p = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
|
|
5808
5855
|
let { tenant: T, apiUrl: E, locale: D } = o(Y), O = o(Ft)?.[t], [k, A] = d(null), [j, M] = d(() => {
|
|
5809
5856
|
let e = /* @__PURE__ */ new Date();
|
|
5810
5857
|
return {
|
|
@@ -5827,13 +5874,13 @@ function zi({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
5827
5874
|
E,
|
|
5828
5875
|
O
|
|
5829
5876
|
]);
|
|
5830
|
-
let N =
|
|
5877
|
+
let N = Fi[u] ?? Fi.medium, P = f || "var(--page-accent, #4f46e5)", F = v || "var(--page-border, rgba(148, 163, 184, 0.35))", I = p || P, L = _ || "var(--page-accent-text, #ffffff)", R = t ? zi(O ?? k ?? [], {
|
|
5831
5878
|
titleField: n,
|
|
5832
5879
|
startField: r,
|
|
5833
5880
|
endField: i,
|
|
5834
5881
|
hrefField: a,
|
|
5835
5882
|
colorField: c
|
|
5836
|
-
}) :
|
|
5883
|
+
}) : Bi(e), z = Vi(R), B = D || void 0, V = (e, t) => {
|
|
5837
5884
|
let n = /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("span", {
|
|
5838
5885
|
...X("event-dot"),
|
|
5839
5886
|
style: {
|
|
@@ -5976,9 +6023,9 @@ function zi({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
5976
6023
|
})]
|
|
5977
6024
|
});
|
|
5978
6025
|
}
|
|
5979
|
-
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(), ie = Math.ceil((K + re) / 7), ae =
|
|
6026
|
+
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(), ie = Math.ceil((K + re) / 7), ae = Ii(/* @__PURE__ */ new Date()), oe = new Intl.DateTimeFormat(B, { weekday: "short" }), se = [];
|
|
5980
6027
|
for (let e = 0; e < ie * 7; e += 1) {
|
|
5981
|
-
let t = e - K + 1, n = t >= 1 && t <= re, r =
|
|
6028
|
+
let t = e - K + 1, n = t >= 1 && t <= re, r = Ii(new Date(j.year, j.month, t)), i = n ? z.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ae;
|
|
5982
6029
|
se.push(/* @__PURE__ */ g("div", {
|
|
5983
6030
|
...X("day", !n && "day-outside", o && "day-today"),
|
|
5984
6031
|
style: {
|
|
@@ -6048,12 +6095,12 @@ function zi({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
6048
6095
|
]
|
|
6049
6096
|
});
|
|
6050
6097
|
}
|
|
6051
|
-
var
|
|
6098
|
+
var Ui = {
|
|
6052
6099
|
small: 36,
|
|
6053
6100
|
medium: 56,
|
|
6054
6101
|
large: 88
|
|
6055
6102
|
};
|
|
6056
|
-
function
|
|
6103
|
+
function Wi(e, t = {}) {
|
|
6057
6104
|
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : Yt(e);
|
|
6058
6105
|
return n.map((e) => {
|
|
6059
6106
|
let n = e.data ?? e, i = qt(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(qt(n, t.nameField)) : r(n.name);
|
|
@@ -6064,7 +6111,7 @@ function Vi(e, t = {}) {
|
|
|
6064
6111
|
};
|
|
6065
6112
|
}).filter((e) => e.src);
|
|
6066
6113
|
}
|
|
6067
|
-
function
|
|
6114
|
+
function Gi({ logos: e = [], source: t = "", imageField: n = "", nameField: r = "", hrefField: i = "", variant: a = "step", size: c = "medium", perView: l = 5, gap: f = 48, hold: p = 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 }) {
|
|
6068
6115
|
let { tenant: D, apiUrl: O } = o(Y), k = o(Ft)?.[t], [A, j] = d(null), M = u(null), N = u(null), [P, F] = d(0), [I, L] = d(0), [R, z] = d(0), [B, V] = d(!0), [H, ee] = d(!1), [W, te] = d(!1);
|
|
6069
6116
|
s(() => {
|
|
6070
6117
|
if (!t || k) return;
|
|
@@ -6104,11 +6151,11 @@ function Hi({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
6104
6151
|
t = !1, r.forEach((e) => e.removeEventListener("load", n));
|
|
6105
6152
|
};
|
|
6106
6153
|
});
|
|
6107
|
-
let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], G = t ?
|
|
6154
|
+
let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], G = t ? Wi(k ?? A ?? [], {
|
|
6108
6155
|
imageField: n,
|
|
6109
6156
|
nameField: r,
|
|
6110
6157
|
hrefField: i
|
|
6111
|
-
}) : ne, K =
|
|
6158
|
+
}) : ne, K = Ui[c] ?? Ui.medium, re = Number.isFinite(Number(f)) ? Math.max(0, Number(f)) : 48, ie = a === "marquee" ? "step" : a, ae = Math.min(3e4, Math.max(300, (Number(p) || 3) * 1e3)), oe = Math.min(3e3, Math.max(100, Number(_) || 500)), se = Math.min(12, Math.max(1, Math.round(Number(l) || 5))), ce = (I || K * 3) + re, le = P ? Math.max(1, Math.floor(P / ce)) : se, ue = Math.min(se, le), de = P ? Math.min(ce, P / ue) : ce;
|
|
6112
6159
|
if (!G.length) return /* @__PURE__ */ h("div", {
|
|
6113
6160
|
ref: T,
|
|
6114
6161
|
style: {
|
|
@@ -6299,7 +6346,7 @@ function Hi({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
6299
6346
|
xe,
|
|
6300
6347
|
q ? J(1) : null
|
|
6301
6348
|
] }),
|
|
6302
|
-
/* @__PURE__ */ h(
|
|
6349
|
+
/* @__PURE__ */ h(Ki, {
|
|
6303
6350
|
running: he,
|
|
6304
6351
|
every: ae + oe,
|
|
6305
6352
|
slide: oe,
|
|
@@ -6313,7 +6360,7 @@ function Hi({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
6313
6360
|
]
|
|
6314
6361
|
});
|
|
6315
6362
|
}
|
|
6316
|
-
function
|
|
6363
|
+
function Ki({ running: e, every: t, slide: n, step: r, index: i, total: a, home: o, setIndex: c, setAnimate: l }) {
|
|
6317
6364
|
s(() => {
|
|
6318
6365
|
if (!e) return;
|
|
6319
6366
|
let n = setInterval(() => {
|
|
@@ -6349,13 +6396,13 @@ function Ui({ running: e, every: t, slide: n, step: r, index: i, total: a, home:
|
|
|
6349
6396
|
l
|
|
6350
6397
|
]), null;
|
|
6351
6398
|
}
|
|
6352
|
-
var
|
|
6399
|
+
var qi = {
|
|
6353
6400
|
tablet: 991,
|
|
6354
6401
|
mobileLandscape: 767,
|
|
6355
6402
|
mobile: 478
|
|
6356
|
-
},
|
|
6357
|
-
function
|
|
6358
|
-
let [O, k] = d(!1), A = `wb-drw-${c().replace(/[^\w-]/g, "")}`, j = u(null), M = t === "always" ? "" : `(max-width: ${
|
|
6403
|
+
}, Ji = "M4 6h16M4 12h16M4 18h16", Yi = (e) => e && hr[e] ? hr[e] : Ji;
|
|
6404
|
+
function Xi({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", width: r = 300, trigger: i = "button", triggerLabel: o = "", icon: l = "", title: f = "", showClose: _ = !0, backdropClose: v = !0, closeOnLink: y = !0, forceMode: b, frame: x, editorOpen: S = !0, editorLabel: C = "Drawer", linked: w, style: T, nodeRef: E, inert: D = !1 }) {
|
|
6405
|
+
let [O, k] = d(!1), A = `wb-drw-${c().replace(/[^\w-]/g, "")}`, j = u(null), M = t === "always" ? "" : `(max-width: ${qi[t] ?? 991}px)`, N = a(() => b ? b === "drawer" : !M || typeof window < "u" && window.matchMedia(M).matches, [b, M]), P = u(null), [F, I] = d(null);
|
|
6359
6406
|
s(() => {
|
|
6360
6407
|
if (D || typeof window > "u") return;
|
|
6361
6408
|
let e = () => {
|
|
@@ -6575,7 +6622,7 @@ function qi({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", widt
|
|
|
6575
6622
|
strokeLinecap: "round",
|
|
6576
6623
|
strokeLinejoin: "round",
|
|
6577
6624
|
"aria-hidden": "true",
|
|
6578
|
-
children: /* @__PURE__ */ h("path", { d:
|
|
6625
|
+
children: /* @__PURE__ */ h("path", { d: Yi(l) })
|
|
6579
6626
|
}), o ? /* @__PURE__ */ h("span", { children: o }) : null]
|
|
6580
6627
|
}),
|
|
6581
6628
|
W && i !== "button" && !te && /* @__PURE__ */ g("div", {
|
|
@@ -6620,8 +6667,8 @@ function qi({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", widt
|
|
|
6620
6667
|
]
|
|
6621
6668
|
});
|
|
6622
6669
|
}
|
|
6623
|
-
function
|
|
6624
|
-
let l = `wb-dbt-${c().replace(/[^\w-]/g, "")}`, u =
|
|
6670
|
+
function Zi({ target: e = "", breakpoint: t = "tablet", label: n = "", icon: r = "", forceMode: i, style: a, nodeRef: o, inert: s = !1 }) {
|
|
6671
|
+
let l = `wb-dbt-${c().replace(/[^\w-]/g, "")}`, u = qi[t], d = i || t === "always" || !u ? "" : `@media (min-width: ${u + 1}px) { .${l} { display: none !important; } }`, f = i === "inline";
|
|
6625
6672
|
return /* @__PURE__ */ g(m, { children: [d ? /* @__PURE__ */ h("style", { children: d }) : null, /* @__PURE__ */ g("button", {
|
|
6626
6673
|
ref: o,
|
|
6627
6674
|
type: "button",
|
|
@@ -6655,20 +6702,20 @@ function Ji({ target: e = "", breakpoint: t = "tablet", label: n = "", icon: r =
|
|
|
6655
6702
|
strokeLinecap: "round",
|
|
6656
6703
|
strokeLinejoin: "round",
|
|
6657
6704
|
"aria-hidden": "true",
|
|
6658
|
-
children: /* @__PURE__ */ h("path", { d:
|
|
6705
|
+
children: /* @__PURE__ */ h("path", { d: Yi(r) })
|
|
6659
6706
|
}), n ? /* @__PURE__ */ h("span", {
|
|
6660
6707
|
...X("label"),
|
|
6661
6708
|
children: n
|
|
6662
6709
|
}) : null]
|
|
6663
6710
|
})] });
|
|
6664
6711
|
}
|
|
6665
|
-
var
|
|
6712
|
+
var Qi = {
|
|
6666
6713
|
small: 380,
|
|
6667
6714
|
medium: 560,
|
|
6668
6715
|
large: 820,
|
|
6669
6716
|
full: "100%"
|
|
6670
6717
|
};
|
|
6671
|
-
function
|
|
6718
|
+
function $i({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: i = 0, size: a = "medium", title: o = "", showClose: c = !0, backdropClose: l = !0, position: f = "center", actions: p = [], showCloseAction: m = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
|
|
6672
6719
|
let [C, w] = d(!1), T = u(null);
|
|
6673
6720
|
s(() => {
|
|
6674
6721
|
if (S || !e) return;
|
|
@@ -6693,7 +6740,7 @@ function Xi({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
6693
6740
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
6694
6741
|
};
|
|
6695
6742
|
}, [S, C]);
|
|
6696
|
-
let E =
|
|
6743
|
+
let E = Qi[a] ?? Qi.medium, D = (e) => {
|
|
6697
6744
|
let t = e.variant ?? "primary", n = {
|
|
6698
6745
|
padding: "9px 16px",
|
|
6699
6746
|
borderRadius: 6,
|
|
@@ -6871,7 +6918,7 @@ function Xi({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
6871
6918
|
})]
|
|
6872
6919
|
});
|
|
6873
6920
|
}
|
|
6874
|
-
function
|
|
6921
|
+
function ea({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: i = "left", panelWidth: a = "", offset: o = 8, editorOpen: c = !0, linked: l, style: f, nodeRef: p, inert: m = !1 }) {
|
|
6875
6922
|
let [_, v] = d(!1), y = u(null), b = u(null), x = r !== "click", S = () => {
|
|
6876
6923
|
b.current && clearTimeout(b.current), b.current = null;
|
|
6877
6924
|
}, C = () => {
|
|
@@ -6974,15 +7021,15 @@ function Zi({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu
|
|
|
6974
7021
|
}), E]
|
|
6975
7022
|
});
|
|
6976
7023
|
}
|
|
6977
|
-
var
|
|
7024
|
+
var ta = {
|
|
6978
7025
|
PageRoot: un,
|
|
6979
7026
|
MarkdownBlock: kn,
|
|
6980
|
-
CalendarBlock:
|
|
6981
|
-
LogoCarousel:
|
|
6982
|
-
DialogBlock:
|
|
6983
|
-
DrawerBlock:
|
|
6984
|
-
DrawerTrigger:
|
|
6985
|
-
DropdownBlock:
|
|
7027
|
+
CalendarBlock: Hi,
|
|
7028
|
+
LogoCarousel: Gi,
|
|
7029
|
+
DialogBlock: $i,
|
|
7030
|
+
DrawerBlock: Xi,
|
|
7031
|
+
DrawerTrigger: Zi,
|
|
7032
|
+
DropdownBlock: ea,
|
|
6986
7033
|
Section: dn,
|
|
6987
7034
|
Container: fn,
|
|
6988
7035
|
LinkBlock: pn,
|
|
@@ -6995,24 +7042,24 @@ var Qi = {
|
|
|
6995
7042
|
BoxBlock: Xn,
|
|
6996
7043
|
SliderBlock: nr,
|
|
6997
7044
|
CanvasSlider: rr,
|
|
6998
|
-
TabsBlock:
|
|
6999
|
-
QuickStack:
|
|
7000
|
-
CollectionList:
|
|
7001
|
-
CollectionSearch:
|
|
7002
|
-
BreadcrumbsBlock:
|
|
7003
|
-
PaginationBlock:
|
|
7004
|
-
StepperBlock:
|
|
7005
|
-
SocialLinksBlock:
|
|
7006
|
-
ThemeModeBlock:
|
|
7007
|
-
ScrollTopBlock:
|
|
7008
|
-
CounterBlock:
|
|
7009
|
-
OrgChartBlock:
|
|
7010
|
-
TableBlock:
|
|
7011
|
-
IconBlock:
|
|
7012
|
-
MapBlock:
|
|
7013
|
-
MasonryBlock:
|
|
7014
|
-
AccordionBlock:
|
|
7015
|
-
NavbarBlock:
|
|
7045
|
+
TabsBlock: Cr,
|
|
7046
|
+
QuickStack: Jr,
|
|
7047
|
+
CollectionList: Xr,
|
|
7048
|
+
CollectionSearch: Zr,
|
|
7049
|
+
BreadcrumbsBlock: Qr,
|
|
7050
|
+
PaginationBlock: $r,
|
|
7051
|
+
StepperBlock: gi,
|
|
7052
|
+
SocialLinksBlock: hi,
|
|
7053
|
+
ThemeModeBlock: ii,
|
|
7054
|
+
ScrollTopBlock: pi,
|
|
7055
|
+
CounterBlock: fi,
|
|
7056
|
+
OrgChartBlock: Oi,
|
|
7057
|
+
TableBlock: Pi,
|
|
7058
|
+
IconBlock: gr,
|
|
7059
|
+
MapBlock: mr,
|
|
7060
|
+
MasonryBlock: vr,
|
|
7061
|
+
AccordionBlock: wr,
|
|
7062
|
+
NavbarBlock: Sr,
|
|
7016
7063
|
ListBlock: Mn,
|
|
7017
7064
|
TextSpan: yn,
|
|
7018
7065
|
QuoteBlock: jn,
|
|
@@ -7024,55 +7071,55 @@ var Qi = {
|
|
|
7024
7071
|
IframeBlock: Hn,
|
|
7025
7072
|
PdfBlock: Wn,
|
|
7026
7073
|
EmbedBlock: qn,
|
|
7027
|
-
FormBlock:
|
|
7028
|
-
FormLabel:
|
|
7029
|
-
FormInput:
|
|
7030
|
-
FormTextarea:
|
|
7031
|
-
FormCheckbox: (e) => /* @__PURE__ */ h(
|
|
7074
|
+
FormBlock: Ir,
|
|
7075
|
+
FormLabel: Vr,
|
|
7076
|
+
FormInput: Hr,
|
|
7077
|
+
FormTextarea: Ur,
|
|
7078
|
+
FormCheckbox: (e) => /* @__PURE__ */ h(Wr, {
|
|
7032
7079
|
kind: "checkbox",
|
|
7033
7080
|
...e
|
|
7034
7081
|
}),
|
|
7035
|
-
FormRadio: (e) => /* @__PURE__ */ h(
|
|
7082
|
+
FormRadio: (e) => /* @__PURE__ */ h(Wr, {
|
|
7036
7083
|
kind: "radio",
|
|
7037
7084
|
...e
|
|
7038
7085
|
}),
|
|
7039
|
-
FormSelect:
|
|
7040
|
-
FormFile:
|
|
7041
|
-
FormRecaptcha:
|
|
7042
|
-
FormSubmit:
|
|
7043
|
-
},
|
|
7086
|
+
FormSelect: Gr,
|
|
7087
|
+
FormFile: Kr,
|
|
7088
|
+
FormRecaptcha: Br,
|
|
7089
|
+
FormSubmit: qr
|
|
7090
|
+
}, na = {
|
|
7044
7091
|
id: "auth",
|
|
7045
7092
|
label: "Accounts",
|
|
7046
7093
|
category: "Apps",
|
|
7047
7094
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
7048
7095
|
ssr: "shell",
|
|
7049
7096
|
settings: ["site.authRedirect"]
|
|
7050
|
-
},
|
|
7097
|
+
}, ra = n({
|
|
7051
7098
|
user: null,
|
|
7052
7099
|
status: "idle",
|
|
7053
7100
|
ensure: () => {},
|
|
7054
7101
|
refresh: () => {},
|
|
7055
7102
|
signOut: () => {}
|
|
7056
7103
|
});
|
|
7057
|
-
function
|
|
7104
|
+
function ia(e, t) {
|
|
7058
7105
|
return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
|
|
7059
7106
|
}
|
|
7060
|
-
function
|
|
7107
|
+
function aa(e) {
|
|
7061
7108
|
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);
|
|
7062
7109
|
return {
|
|
7063
7110
|
mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
|
|
7064
7111
|
url: i,
|
|
7065
7112
|
mePath: a,
|
|
7066
7113
|
logoutPath: o,
|
|
7067
|
-
meUrl:
|
|
7068
|
-
logoutUrl:
|
|
7114
|
+
meUrl: ia(i, a),
|
|
7115
|
+
logoutUrl: ia(i, o),
|
|
7069
7116
|
loginPage: r(n.loginPage),
|
|
7070
7117
|
userPath: r(n.userPath),
|
|
7071
7118
|
auth: n.auth === "bearer" ? "bearer" : "cookies",
|
|
7072
7119
|
tokenKey: r(n.tokenKey) || "webim_session_token"
|
|
7073
7120
|
};
|
|
7074
7121
|
}
|
|
7075
|
-
function
|
|
7122
|
+
function oa(e, t) {
|
|
7076
7123
|
if (!t) return e ?? null;
|
|
7077
7124
|
let n = e;
|
|
7078
7125
|
for (let e of t.split(".")) {
|
|
@@ -7081,26 +7128,26 @@ function ra(e, t) {
|
|
|
7081
7128
|
}
|
|
7082
7129
|
return n ?? null;
|
|
7083
7130
|
}
|
|
7084
|
-
function
|
|
7131
|
+
function sa(e) {
|
|
7085
7132
|
try {
|
|
7086
7133
|
return window.localStorage.getItem(e) || "";
|
|
7087
7134
|
} catch {
|
|
7088
7135
|
return "";
|
|
7089
7136
|
}
|
|
7090
7137
|
}
|
|
7091
|
-
function
|
|
7138
|
+
function ca(e) {
|
|
7092
7139
|
try {
|
|
7093
7140
|
window.localStorage.removeItem(e);
|
|
7094
7141
|
} catch {}
|
|
7095
7142
|
}
|
|
7096
|
-
var
|
|
7097
|
-
let e = o(
|
|
7143
|
+
var la = () => {
|
|
7144
|
+
let e = o(ra);
|
|
7098
7145
|
return s(() => {
|
|
7099
7146
|
e.ensure();
|
|
7100
7147
|
}, [e]), e;
|
|
7101
7148
|
};
|
|
7102
|
-
function
|
|
7103
|
-
let c = o(Y), f = r || c?.apiUrl || "/api", p = i || c?.tenant || "", m = l(() =>
|
|
7149
|
+
function ua({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i }) {
|
|
7150
|
+
let c = o(Y), f = r || c?.apiUrl || "/api", p = i || c?.tenant || "", m = l(() => aa(c?.settings), [c?.settings]), [g, _] = d(t ?? null), [v, y] = d(t ? "user" : n ? "guest" : "idle"), b = u(!1), x = a((e, t) => fetch(`${f}${e}`, {
|
|
7104
7151
|
...t,
|
|
7105
7152
|
credentials: "include",
|
|
7106
7153
|
headers: {
|
|
@@ -7112,9 +7159,9 @@ function sa({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
|
|
|
7112
7159
|
if (n) return Promise.resolve(null);
|
|
7113
7160
|
if (m.mode === "off") return Promise.resolve(S(null));
|
|
7114
7161
|
if (m.mode === "custom") {
|
|
7115
|
-
let e = m.auth === "bearer" ?
|
|
7162
|
+
let e = m.auth === "bearer" ? sa(m.tokenKey) : "";
|
|
7116
7163
|
return !m.meUrl || m.auth === "bearer" && !e ? Promise.resolve(S(null)) : fetch(m.meUrl, { ...m.auth === "bearer" ? { headers: { authorization: `Bearer ${e}` } } : { credentials: "include" } }).then((e) => e.ok ? e.json() : null).then((e) => {
|
|
7117
|
-
let t =
|
|
7164
|
+
let t = oa(e, m.userPath);
|
|
7118
7165
|
return S(t && typeof t == "object" ? t : null);
|
|
7119
7166
|
}).catch(() => S(null));
|
|
7120
7167
|
}
|
|
@@ -7127,12 +7174,12 @@ function sa({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
|
|
|
7127
7174
|
]), w = a(() => {
|
|
7128
7175
|
if (m.mode === "off") return S(null), Promise.resolve();
|
|
7129
7176
|
if (m.mode === "custom") {
|
|
7130
|
-
let e = m.auth === "bearer" ?
|
|
7177
|
+
let e = m.auth === "bearer" ? sa(m.tokenKey) : "";
|
|
7131
7178
|
return (m.logoutUrl ? fetch(m.logoutUrl, {
|
|
7132
7179
|
method: "post",
|
|
7133
7180
|
...m.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
|
|
7134
7181
|
}).catch(() => {}) : Promise.resolve()).then(() => {
|
|
7135
|
-
m.auth === "bearer" &&
|
|
7182
|
+
m.auth === "bearer" && ca(m.tokenKey), S(null);
|
|
7136
7183
|
});
|
|
7137
7184
|
}
|
|
7138
7185
|
return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
@@ -7182,18 +7229,18 @@ function sa({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
|
|
|
7182
7229
|
m.loginPage,
|
|
7183
7230
|
C,
|
|
7184
7231
|
w
|
|
7185
|
-
]), /* @__PURE__ */ h(
|
|
7232
|
+
]), /* @__PURE__ */ h(ra.Provider, {
|
|
7186
7233
|
value: E,
|
|
7187
7234
|
children: e
|
|
7188
7235
|
});
|
|
7189
7236
|
}
|
|
7190
|
-
function
|
|
7191
|
-
let { status: n } =
|
|
7237
|
+
function da({ when: e, children: t }) {
|
|
7238
|
+
let { status: n } = la();
|
|
7192
7239
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
7193
7240
|
}
|
|
7194
7241
|
//#endregion
|
|
7195
7242
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
7196
|
-
function
|
|
7243
|
+
function fa({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: i = "Name", submitLabel: a, style: s, nodeRef: c, inert: l, linked: u, show: f }) {
|
|
7197
7244
|
let { tenant: p, apiUrl: m, settings: _ } = o(Y), [v, y] = d("form"), [b, x] = d(""), [S, C] = d(!1), w = e === "register", T = l ? f || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
|
|
7198
7245
|
if (e.preventDefault(), l) return;
|
|
7199
7246
|
let n = new FormData(e.currentTarget);
|
|
@@ -7244,7 +7291,7 @@ function la({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
7244
7291
|
w ? /* @__PURE__ */ g("label", {
|
|
7245
7292
|
...X("label"),
|
|
7246
7293
|
style: {
|
|
7247
|
-
...
|
|
7294
|
+
...Er,
|
|
7248
7295
|
display: "grid",
|
|
7249
7296
|
gap: 6
|
|
7250
7297
|
},
|
|
@@ -7253,13 +7300,13 @@ function la({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
7253
7300
|
name: "name",
|
|
7254
7301
|
type: "text",
|
|
7255
7302
|
style: Z,
|
|
7256
|
-
...
|
|
7303
|
+
...Or(l)
|
|
7257
7304
|
})]
|
|
7258
7305
|
}) : null,
|
|
7259
7306
|
/* @__PURE__ */ g("label", {
|
|
7260
7307
|
...X("label"),
|
|
7261
7308
|
style: {
|
|
7262
|
-
...
|
|
7309
|
+
...Er,
|
|
7263
7310
|
display: "grid",
|
|
7264
7311
|
gap: 6
|
|
7265
7312
|
},
|
|
@@ -7269,13 +7316,13 @@ function la({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
7269
7316
|
type: "email",
|
|
7270
7317
|
required: !l,
|
|
7271
7318
|
style: Z,
|
|
7272
|
-
...
|
|
7319
|
+
...Or(l)
|
|
7273
7320
|
})]
|
|
7274
7321
|
}),
|
|
7275
7322
|
/* @__PURE__ */ g("label", {
|
|
7276
7323
|
...X("label"),
|
|
7277
7324
|
style: {
|
|
7278
|
-
...
|
|
7325
|
+
...Er,
|
|
7279
7326
|
display: "grid",
|
|
7280
7327
|
gap: 6
|
|
7281
7328
|
},
|
|
@@ -7285,7 +7332,7 @@ function la({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
7285
7332
|
type: "password",
|
|
7286
7333
|
required: !l,
|
|
7287
7334
|
style: Z,
|
|
7288
|
-
...
|
|
7335
|
+
...Or(l)
|
|
7289
7336
|
})]
|
|
7290
7337
|
}),
|
|
7291
7338
|
/* @__PURE__ */ h("button", {
|
|
@@ -7326,8 +7373,8 @@ function la({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
7326
7373
|
]
|
|
7327
7374
|
});
|
|
7328
7375
|
}
|
|
7329
|
-
function
|
|
7330
|
-
let { user: c, status: l, signOut: u } =
|
|
7376
|
+
function pa({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
7377
|
+
let { user: c, status: l, signOut: u } = la(), d = a ? s || "user" : l, f = a ? {
|
|
7331
7378
|
name: "Ada Lovelace",
|
|
7332
7379
|
email: "ada@example.com"
|
|
7333
7380
|
} : c;
|
|
@@ -7349,7 +7396,7 @@ function ua({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
7349
7396
|
/* @__PURE__ */ g("span", {
|
|
7350
7397
|
...X("greeting"),
|
|
7351
7398
|
style: {
|
|
7352
|
-
...
|
|
7399
|
+
...Er,
|
|
7353
7400
|
fontWeight: 600
|
|
7354
7401
|
},
|
|
7355
7402
|
children: [
|
|
@@ -7361,7 +7408,7 @@ function ua({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
7361
7408
|
n && f?.email ? /* @__PURE__ */ h("span", {
|
|
7362
7409
|
...X("email"),
|
|
7363
7410
|
style: {
|
|
7364
|
-
...
|
|
7411
|
+
...Er,
|
|
7365
7412
|
opacity: .7
|
|
7366
7413
|
},
|
|
7367
7414
|
children: f.email
|
|
@@ -7378,7 +7425,7 @@ function ua({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
7378
7425
|
fontSize: 14,
|
|
7379
7426
|
cursor: a ? "default" : "pointer"
|
|
7380
7427
|
},
|
|
7381
|
-
...
|
|
7428
|
+
...Or(a),
|
|
7382
7429
|
children: t
|
|
7383
7430
|
})
|
|
7384
7431
|
]
|
|
@@ -7395,40 +7442,40 @@ function ua({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
7395
7442
|
}
|
|
7396
7443
|
//#endregion
|
|
7397
7444
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
7398
|
-
var
|
|
7445
|
+
var ma = {
|
|
7399
7446
|
id: "consent",
|
|
7400
7447
|
label: "Cookie consent",
|
|
7401
7448
|
category: "Apps",
|
|
7402
7449
|
keys: ["CookieConsent"],
|
|
7403
7450
|
ssr: "shell",
|
|
7404
7451
|
settings: []
|
|
7405
|
-
},
|
|
7406
|
-
function
|
|
7452
|
+
}, ha = "webim.cookie_consent";
|
|
7453
|
+
function ga() {
|
|
7407
7454
|
try {
|
|
7408
|
-
let e = window.localStorage.getItem(
|
|
7455
|
+
let e = window.localStorage.getItem(ha), t = e ? JSON.parse(e) : null;
|
|
7409
7456
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
7410
7457
|
} catch {
|
|
7411
7458
|
return "";
|
|
7412
7459
|
}
|
|
7413
7460
|
}
|
|
7414
|
-
function
|
|
7461
|
+
function _a(e) {
|
|
7415
7462
|
try {
|
|
7416
7463
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
7417
7464
|
} catch {}
|
|
7418
7465
|
}
|
|
7419
|
-
function
|
|
7466
|
+
function va(e) {
|
|
7420
7467
|
try {
|
|
7421
|
-
window.localStorage.setItem(
|
|
7468
|
+
window.localStorage.setItem(ha, JSON.stringify({
|
|
7422
7469
|
choice: e,
|
|
7423
7470
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7424
7471
|
}));
|
|
7425
7472
|
} catch {}
|
|
7426
|
-
|
|
7473
|
+
_a(e);
|
|
7427
7474
|
try {
|
|
7428
7475
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
7429
7476
|
} catch {}
|
|
7430
7477
|
}
|
|
7431
|
-
var
|
|
7478
|
+
var ya = {
|
|
7432
7479
|
bottom: {
|
|
7433
7480
|
left: 0,
|
|
7434
7481
|
right: 0,
|
|
@@ -7450,18 +7497,18 @@ var ga = {
|
|
|
7450
7497
|
maxWidth: 400
|
|
7451
7498
|
}
|
|
7452
7499
|
};
|
|
7453
|
-
function
|
|
7500
|
+
function ba({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: a, position: o, linked: c, style: l, nodeRef: u, inert: f }) {
|
|
7454
7501
|
let [p, _] = d(!!f), [v, y] = d(null), b = (e) => {
|
|
7455
7502
|
y(e), typeof u == "function" && u(e);
|
|
7456
7503
|
};
|
|
7457
7504
|
if (s(() => {
|
|
7458
7505
|
if (f) return;
|
|
7459
|
-
let e =
|
|
7460
|
-
e ?
|
|
7506
|
+
let e = ga();
|
|
7507
|
+
e ? _a(e) : _(!0);
|
|
7461
7508
|
}, [f, v]), !p) return null;
|
|
7462
7509
|
let x = (e) => () => {
|
|
7463
|
-
f || (
|
|
7464
|
-
}, S =
|
|
7510
|
+
f || (va(e), _(!1));
|
|
7511
|
+
}, S = ya[o] ?? ya.bottom, C = {
|
|
7465
7512
|
appearance: "none",
|
|
7466
7513
|
font: "inherit",
|
|
7467
7514
|
fontSize: 14,
|
|
@@ -7546,37 +7593,37 @@ function _a({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
7546
7593
|
}
|
|
7547
7594
|
//#endregion
|
|
7548
7595
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
7549
|
-
var
|
|
7596
|
+
var xa = {
|
|
7550
7597
|
id: "language",
|
|
7551
7598
|
label: "Language",
|
|
7552
7599
|
category: "Apps",
|
|
7553
7600
|
keys: ["SiteLanguagePicker"],
|
|
7554
7601
|
ssr: "prefetch",
|
|
7555
7602
|
settings: ["locales"]
|
|
7556
|
-
},
|
|
7603
|
+
}, Sa = {
|
|
7557
7604
|
id: "search",
|
|
7558
7605
|
label: "Search",
|
|
7559
7606
|
category: "Apps",
|
|
7560
7607
|
keys: ["SiteSearch"],
|
|
7561
7608
|
ssr: "prefetch",
|
|
7562
7609
|
settings: []
|
|
7563
|
-
},
|
|
7564
|
-
function
|
|
7610
|
+
}, Ca = 50, wa = 2e3;
|
|
7611
|
+
function Ta() {
|
|
7565
7612
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
7566
7613
|
}
|
|
7567
|
-
function
|
|
7614
|
+
function Ea(e, t) {
|
|
7568
7615
|
let n = e?.data ?? {}, r = [];
|
|
7569
7616
|
for (let e of Object.values(n)) {
|
|
7570
7617
|
let t = e == null ? "" : Yt(e);
|
|
7571
|
-
if (t && r.push(t), r.join(" ").length >
|
|
7618
|
+
if (t && r.push(t), r.join(" ").length > wa) break;
|
|
7572
7619
|
}
|
|
7573
|
-
return r.join(" ").slice(0,
|
|
7620
|
+
return r.join(" ").slice(0, wa).toLocaleLowerCase(t || void 0);
|
|
7574
7621
|
}
|
|
7575
|
-
function
|
|
7576
|
-
let { tenant: x, apiUrl: S, locale: C } = o(Y), [w, T] = d(() =>
|
|
7622
|
+
function Da({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: i = !1, layout: a = "inline", includePages: c = !0, collections: l = [], limit: f = 10, emptyText: p = "Nothing found", hint: m = "", style: _, nodeRef: v, inert: y = !1, sample: b = !1 }) {
|
|
7623
|
+
let { tenant: x, apiUrl: S, locale: C } = o(Y), [w, T] = d(() => Ta()), [E, D] = d(() => Ta()), [O, k] = d(null), [A, j] = d(!1), M = u(null), N = a === "popup";
|
|
7577
7624
|
s(() => {
|
|
7578
7625
|
let e = () => {
|
|
7579
|
-
let e =
|
|
7626
|
+
let e = Ta();
|
|
7580
7627
|
T(e), D(e);
|
|
7581
7628
|
};
|
|
7582
7629
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -7627,7 +7674,7 @@ function wa({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
7627
7674
|
});
|
|
7628
7675
|
}
|
|
7629
7676
|
else for (let t of e.rows) {
|
|
7630
|
-
if (!
|
|
7677
|
+
if (!Ea(t, C).includes(P)) continue;
|
|
7631
7678
|
let n = t?.data ?? {}, r = Yt(n.name) || "Untitled", i = Yt(n.slug);
|
|
7632
7679
|
F.push({
|
|
7633
7680
|
key: `entry:${t.id}`,
|
|
@@ -7636,7 +7683,7 @@ function wa({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
7636
7683
|
kind: "entry"
|
|
7637
7684
|
});
|
|
7638
7685
|
}
|
|
7639
|
-
let I = F.slice(0, Math.min(Math.max(1, f),
|
|
7686
|
+
let I = F.slice(0, Math.min(Math.max(1, f), Ca)), L = (e) => {
|
|
7640
7687
|
if (y) {
|
|
7641
7688
|
e.preventDefault(), T(E), j(!0);
|
|
7642
7689
|
return;
|
|
@@ -7789,7 +7836,7 @@ function wa({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
7789
7836
|
}
|
|
7790
7837
|
//#endregion
|
|
7791
7838
|
//#region ../ui/src/components/builder/apps/shop/manifest.js
|
|
7792
|
-
var
|
|
7839
|
+
var Oa = {
|
|
7793
7840
|
id: "shop",
|
|
7794
7841
|
label: "Shop",
|
|
7795
7842
|
category: "Shop",
|
|
@@ -7804,7 +7851,7 @@ var Ta = {
|
|
|
7804
7851
|
],
|
|
7805
7852
|
ssr: "shell",
|
|
7806
7853
|
settings: ["shop.enabled"]
|
|
7807
|
-
},
|
|
7854
|
+
}, ka = "webim.cart.", Aa = "webim.currency.", ja = /* @__PURE__ */ new Map(), Ma = {
|
|
7808
7855
|
get(e) {
|
|
7809
7856
|
try {
|
|
7810
7857
|
return window.localStorage.getItem(e) ?? "";
|
|
@@ -7818,7 +7865,7 @@ var Ta = {
|
|
|
7818
7865
|
} catch {}
|
|
7819
7866
|
}
|
|
7820
7867
|
};
|
|
7821
|
-
function
|
|
7868
|
+
function Na(e) {
|
|
7822
7869
|
if (typeof window > "u") return !1;
|
|
7823
7870
|
try {
|
|
7824
7871
|
return new URL(e, window.location.href).origin === window.location.origin;
|
|
@@ -7829,7 +7876,7 @@ function Aa(e) {
|
|
|
7829
7876
|
async function Q(e, t, n, { method: r = "GET", body: i } = {}) {
|
|
7830
7877
|
let a = await fetch(`${e}${n}`, {
|
|
7831
7878
|
method: r,
|
|
7832
|
-
...
|
|
7879
|
+
...Na(e) ? { credentials: "include" } : {},
|
|
7833
7880
|
headers: {
|
|
7834
7881
|
...t ? { "x-tenant": t } : {},
|
|
7835
7882
|
...i ? { "content-type": "application/json" } : {}
|
|
@@ -7845,7 +7892,7 @@ async function Q(e, t, n, { method: r = "GET", body: i } = {}) {
|
|
|
7845
7892
|
}
|
|
7846
7893
|
return o.payload;
|
|
7847
7894
|
}
|
|
7848
|
-
var
|
|
7895
|
+
var Pa = {
|
|
7849
7896
|
id: "",
|
|
7850
7897
|
currency: "",
|
|
7851
7898
|
lines: [],
|
|
@@ -7860,25 +7907,25 @@ var ja = {
|
|
|
7860
7907
|
shipping_total: 0,
|
|
7861
7908
|
total: 0
|
|
7862
7909
|
};
|
|
7863
|
-
function
|
|
7864
|
-
let n = `${
|
|
7865
|
-
cart:
|
|
7910
|
+
function Fa(e, t) {
|
|
7911
|
+
let n = `${ka}${t || "default"}`, r = `${Aa}${t || "default"}`, i = /* @__PURE__ */ new Set(), a = {
|
|
7912
|
+
cart: Pa,
|
|
7866
7913
|
loading: !1,
|
|
7867
7914
|
loaded: !1,
|
|
7868
7915
|
error: null,
|
|
7869
|
-
currency:
|
|
7916
|
+
currency: Ma.get(r)
|
|
7870
7917
|
}, o = null, s = () => i.forEach((e) => e()), c = (e) => {
|
|
7871
7918
|
a = {
|
|
7872
7919
|
...a,
|
|
7873
7920
|
...e
|
|
7874
7921
|
}, s();
|
|
7875
|
-
}, l = (e) => (e && typeof e == "object" && (e.id &&
|
|
7922
|
+
}, l = (e) => (e && typeof e == "object" && (e.id && Ma.set(n, e.id), c({
|
|
7876
7923
|
cart: e,
|
|
7877
7924
|
loaded: !0,
|
|
7878
7925
|
error: null
|
|
7879
7926
|
})), e), u = () => {
|
|
7880
7927
|
if (o) return o;
|
|
7881
|
-
let r =
|
|
7928
|
+
let r = Ma.get(n), i = new URLSearchParams({
|
|
7882
7929
|
...r ? { id: r } : {},
|
|
7883
7930
|
...a.currency ? { currency: a.currency } : {}
|
|
7884
7931
|
}).toString();
|
|
@@ -7894,7 +7941,7 @@ function Ma(e, t) {
|
|
|
7894
7941
|
return l(await Q(e, t, "/store/cart", {
|
|
7895
7942
|
method: "POST",
|
|
7896
7943
|
body: {
|
|
7897
|
-
cart_id:
|
|
7944
|
+
cart_id: Ma.get(n) || void 0,
|
|
7898
7945
|
product_id: r,
|
|
7899
7946
|
variant_id: i ?? null,
|
|
7900
7947
|
quantity: o,
|
|
@@ -7906,7 +7953,7 @@ function Ma(e, t) {
|
|
|
7906
7953
|
}
|
|
7907
7954
|
};
|
|
7908
7955
|
return typeof window < "u" && window.addEventListener("storage", (e) => {
|
|
7909
|
-
e.key === r && c({ currency:
|
|
7956
|
+
e.key === r && c({ currency: Ma.get(r) }), (e.key === n || e.key === r) && u();
|
|
7910
7957
|
}), {
|
|
7911
7958
|
getState: () => a,
|
|
7912
7959
|
subscribe: (e) => (i.add(e), () => i.delete(e)),
|
|
@@ -7922,7 +7969,7 @@ function Ma(e, t) {
|
|
|
7922
7969
|
return l(await Q(e, t, "/store/cart/coupon", {
|
|
7923
7970
|
method: "POST",
|
|
7924
7971
|
body: {
|
|
7925
|
-
cart_id:
|
|
7972
|
+
cart_id: Ma.get(n),
|
|
7926
7973
|
code: r
|
|
7927
7974
|
}
|
|
7928
7975
|
}));
|
|
@@ -7930,64 +7977,64 @@ function Ma(e, t) {
|
|
|
7930
7977
|
c({ loading: !1 });
|
|
7931
7978
|
}
|
|
7932
7979
|
},
|
|
7933
|
-
setCountry: async (r, i) =>
|
|
7980
|
+
setCountry: async (r, i) => Ma.get(n) ? l(await Q(e, t, "/store/cart/country", {
|
|
7934
7981
|
method: "POST",
|
|
7935
7982
|
body: {
|
|
7936
|
-
cart_id:
|
|
7983
|
+
cart_id: Ma.get(n),
|
|
7937
7984
|
country: r,
|
|
7938
7985
|
...i !== void 0 && { postal_code: i }
|
|
7939
7986
|
}
|
|
7940
7987
|
})) : a.cart,
|
|
7941
|
-
setDelivery: async (r) =>
|
|
7988
|
+
setDelivery: async (r) => Ma.get(n) ? l(await Q(e, t, "/store/cart/delivery", {
|
|
7942
7989
|
method: "POST",
|
|
7943
7990
|
body: {
|
|
7944
|
-
cart_id:
|
|
7991
|
+
cart_id: Ma.get(n),
|
|
7945
7992
|
delivery: r
|
|
7946
7993
|
}
|
|
7947
7994
|
})) : a.cart,
|
|
7948
7995
|
setCurrency: async (i) => {
|
|
7949
|
-
if (
|
|
7996
|
+
if (Ma.set(r, i), c({ currency: i }), !Ma.get(n)) return u();
|
|
7950
7997
|
try {
|
|
7951
7998
|
return l(await Q(e, t, "/store/cart/currency", {
|
|
7952
7999
|
method: "POST",
|
|
7953
8000
|
body: {
|
|
7954
|
-
cart_id:
|
|
8001
|
+
cart_id: Ma.get(n),
|
|
7955
8002
|
currency: i
|
|
7956
8003
|
}
|
|
7957
8004
|
}));
|
|
7958
8005
|
} catch {
|
|
7959
|
-
return
|
|
8006
|
+
return Ma.set(r, ""), c({ currency: "" }), u();
|
|
7960
8007
|
}
|
|
7961
8008
|
},
|
|
7962
8009
|
reset: () => {
|
|
7963
|
-
|
|
8010
|
+
Ma.set(n, ""), c({ cart: Pa });
|
|
7964
8011
|
},
|
|
7965
|
-
cartId: () =>
|
|
8012
|
+
cartId: () => Ma.get(n)
|
|
7966
8013
|
};
|
|
7967
8014
|
}
|
|
7968
|
-
function
|
|
8015
|
+
function Ia(e, t) {
|
|
7969
8016
|
let n = `${e}|${t}`;
|
|
7970
|
-
return
|
|
8017
|
+
return ja.has(n) || ja.set(n, Fa(e, t)), ja.get(n);
|
|
7971
8018
|
}
|
|
7972
|
-
function
|
|
8019
|
+
function La(e, t) {
|
|
7973
8020
|
let n = Array.isArray(e?.currencies) ? e.currencies : [];
|
|
7974
8021
|
return t && n.includes(t) ? t : e?.currency || "";
|
|
7975
8022
|
}
|
|
7976
|
-
var
|
|
7977
|
-
function
|
|
8023
|
+
var Ra = "AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" ");
|
|
8024
|
+
function za(e, t = [], n = null) {
|
|
7978
8025
|
let r;
|
|
7979
8026
|
try {
|
|
7980
8027
|
r = new Intl.DisplayNames([e || "en"], { type: "region" });
|
|
7981
8028
|
} catch {
|
|
7982
8029
|
r = { of: (e) => e };
|
|
7983
8030
|
}
|
|
7984
|
-
let i = (n ??
|
|
8031
|
+
let i = (n ?? Ra).map((e) => ({
|
|
7985
8032
|
code: e,
|
|
7986
8033
|
name: r.of(e) ?? e
|
|
7987
8034
|
})), a = i.filter((e) => t.includes(e.code)).sort((t, n) => t.name.localeCompare(n.name, e || void 0)), o = i.filter((e) => !t.includes(e.code)).sort((t, n) => t.name.localeCompare(n.name, e || void 0));
|
|
7988
8035
|
return [...a, ...o];
|
|
7989
8036
|
}
|
|
7990
|
-
function
|
|
8037
|
+
function Ba(e, t, n) {
|
|
7991
8038
|
let r = t || "USD";
|
|
7992
8039
|
try {
|
|
7993
8040
|
let t = new Intl.NumberFormat(n || void 0, {
|
|
@@ -7999,7 +8046,7 @@ function La(e, t, n) {
|
|
|
7999
8046
|
return `${(Number(e || 0) / 100).toFixed(2)} ${r}`;
|
|
8000
8047
|
}
|
|
8001
8048
|
}
|
|
8002
|
-
var
|
|
8049
|
+
var Va = {
|
|
8003
8050
|
en: {
|
|
8004
8051
|
add: "Add to cart",
|
|
8005
8052
|
adding: "Adding…",
|
|
@@ -8331,24 +8378,24 @@ var Ra = {
|
|
|
8331
8378
|
no: "Hayır"
|
|
8332
8379
|
}
|
|
8333
8380
|
};
|
|
8334
|
-
function
|
|
8335
|
-
let t =
|
|
8336
|
-
let r = t[e] ??
|
|
8381
|
+
function Ha(e) {
|
|
8382
|
+
let t = Va[String(e || "").toLowerCase().split("-")[0]] ?? Va.en, n = (e, n) => {
|
|
8383
|
+
let r = t[e] ?? Va.en[e] ?? e;
|
|
8337
8384
|
return n ? r.replace(/\{(\w+)\}/g, (e, t) => t in n ? String(n[t]) : e) : r;
|
|
8338
8385
|
};
|
|
8339
|
-
return n.has = (e) => e in
|
|
8386
|
+
return n.has = (e) => e in Va.en, n;
|
|
8340
8387
|
}
|
|
8341
|
-
var
|
|
8342
|
-
function
|
|
8388
|
+
var Ua = (e, t) => t?.code && e.has(t.code) ? e(t.code) : t?.message ?? "", Wa = /* @__PURE__ */ new Map();
|
|
8389
|
+
function Ga(e, t) {
|
|
8343
8390
|
let n = `${e}|${t}`;
|
|
8344
|
-
return
|
|
8391
|
+
return Wa.has(n) || Wa.set(n, Q(e, t, "/store/policies").then((e) => Array.isArray(e) ? e : []).catch(() => (Wa.delete(n), []))), Wa.get(n);
|
|
8345
8392
|
}
|
|
8346
|
-
function
|
|
8393
|
+
function Ka(e) {
|
|
8347
8394
|
let t = /* @__PURE__ */ new Date(), n = Math.max(0, Math.round(Number(e) || 0));
|
|
8348
8395
|
for (; n > 0;) t.setDate(t.getDate() + 1), t.getDay() !== 0 && t.getDay() !== 6 && --n;
|
|
8349
8396
|
return t;
|
|
8350
8397
|
}
|
|
8351
|
-
function
|
|
8398
|
+
function qa(e, t, n, r) {
|
|
8352
8399
|
let i = (e) => e != null && Number.isFinite(Number(e));
|
|
8353
8400
|
if (!i(n) && !i(r)) return "";
|
|
8354
8401
|
let a;
|
|
@@ -8363,7 +8410,7 @@ function Wa(e, t, n, r) {
|
|
|
8363
8410
|
day: "numeric"
|
|
8364
8411
|
});
|
|
8365
8412
|
}
|
|
8366
|
-
let o = a.format(
|
|
8413
|
+
let o = a.format(Ka(i(n) ? n : r)), s = a.format(Ka(i(r) ? r : n));
|
|
8367
8414
|
return o === s ? e("arrives", { date: o }) : e("arrivesRange", {
|
|
8368
8415
|
from: o,
|
|
8369
8416
|
to: s
|
|
@@ -8371,7 +8418,7 @@ function Wa(e, t, n, r) {
|
|
|
8371
8418
|
}
|
|
8372
8419
|
//#endregion
|
|
8373
8420
|
//#region ../ui/src/components/builder/apps/shop/engagement.jsx
|
|
8374
|
-
var
|
|
8421
|
+
var Ja = "var(--page-muted, rgba(100,116,139,1))", Ya = "1px solid var(--page-border, #d1d5db)", Xa = "var(--page-surface, #f2f2f2)", Za = "#f59e0b", Qa = {
|
|
8375
8422
|
...an,
|
|
8376
8423
|
border: 0,
|
|
8377
8424
|
borderRadius: "8px",
|
|
@@ -8379,14 +8426,14 @@ var Ga = "var(--page-muted, rgba(100,116,139,1))", Ka = "1px solid var(--page-bo
|
|
|
8379
8426
|
fontSize: "14px",
|
|
8380
8427
|
fontWeight: 600,
|
|
8381
8428
|
fontFamily: "inherit"
|
|
8382
|
-
},
|
|
8383
|
-
...
|
|
8429
|
+
}, $a = {
|
|
8430
|
+
...Qa,
|
|
8384
8431
|
backgroundColor: "transparent",
|
|
8385
8432
|
color: "var(--page-text, #111827)",
|
|
8386
|
-
border:
|
|
8433
|
+
border: Ya
|
|
8387
8434
|
};
|
|
8388
|
-
function
|
|
8389
|
-
let { tenant: e, apiUrl: t, locale: n, settings: r } = o(Y), i = l(() =>
|
|
8435
|
+
function eo() {
|
|
8436
|
+
let { tenant: e, apiUrl: t, locale: n, settings: r } = o(Y), i = l(() => Ha(n), [n]), a = (e) => r?.[e] !== !1;
|
|
8390
8437
|
return {
|
|
8391
8438
|
tenant: e,
|
|
8392
8439
|
apiUrl: t || "/api",
|
|
@@ -8397,12 +8444,12 @@ function Za() {
|
|
|
8397
8444
|
favoritesOn: a("shop.favorites"),
|
|
8398
8445
|
moderated: r?.["shop.reviewModeration"] !== "auto",
|
|
8399
8446
|
loginHref: () => {
|
|
8400
|
-
let e =
|
|
8447
|
+
let e = aa(r).loginPage || "/login", t = typeof window > "u" ? "" : `${window.location.pathname}${window.location.search}`;
|
|
8401
8448
|
return t ? `${e}${e.includes("?") ? "&" : "?"}next=${encodeURIComponent(t)}` : e;
|
|
8402
8449
|
}
|
|
8403
8450
|
};
|
|
8404
8451
|
}
|
|
8405
|
-
var
|
|
8452
|
+
var to = (e, t) => {
|
|
8406
8453
|
try {
|
|
8407
8454
|
return new Intl.NumberFormat(t || void 0, {
|
|
8408
8455
|
notation: "compact",
|
|
@@ -8411,7 +8458,7 @@ var Qa = (e, t) => {
|
|
|
8411
8458
|
} catch {
|
|
8412
8459
|
return String(e);
|
|
8413
8460
|
}
|
|
8414
|
-
},
|
|
8461
|
+
}, no = (e, t) => {
|
|
8415
8462
|
try {
|
|
8416
8463
|
return new Intl.DateTimeFormat(t || void 0, {
|
|
8417
8464
|
day: "numeric",
|
|
@@ -8421,8 +8468,8 @@ var Qa = (e, t) => {
|
|
|
8421
8468
|
} catch {
|
|
8422
8469
|
return String(e).slice(0, 10);
|
|
8423
8470
|
}
|
|
8424
|
-
},
|
|
8425
|
-
function
|
|
8471
|
+
}, ro = "M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z";
|
|
8472
|
+
function io({ fill: e = 0, size: t = 16, clipId: n }) {
|
|
8426
8473
|
return /* @__PURE__ */ g("svg", {
|
|
8427
8474
|
width: t,
|
|
8428
8475
|
height: t,
|
|
@@ -8440,18 +8487,18 @@ function to({ fill: e = 0, size: t = 16, clipId: n }) {
|
|
|
8440
8487
|
})
|
|
8441
8488
|
}) }),
|
|
8442
8489
|
/* @__PURE__ */ h("path", {
|
|
8443
|
-
d:
|
|
8490
|
+
d: ro,
|
|
8444
8491
|
fill: "var(--page-border, #d1d5db)"
|
|
8445
8492
|
}),
|
|
8446
8493
|
e > 0 && /* @__PURE__ */ h("path", {
|
|
8447
|
-
d:
|
|
8448
|
-
fill:
|
|
8494
|
+
d: ro,
|
|
8495
|
+
fill: Za,
|
|
8449
8496
|
clipPath: `url(#${n})`
|
|
8450
8497
|
})
|
|
8451
8498
|
]
|
|
8452
8499
|
});
|
|
8453
8500
|
}
|
|
8454
|
-
function
|
|
8501
|
+
function ao({ value: e = 0, size: t = 16 }) {
|
|
8455
8502
|
let n = c().replace(/:/g, "");
|
|
8456
8503
|
return /* @__PURE__ */ h("span", {
|
|
8457
8504
|
role: "img",
|
|
@@ -8468,14 +8515,14 @@ function no({ value: e = 0, size: t = 16 }) {
|
|
|
8468
8515
|
2,
|
|
8469
8516
|
3,
|
|
8470
8517
|
4
|
|
8471
|
-
].map((r) => /* @__PURE__ */ h(
|
|
8518
|
+
].map((r) => /* @__PURE__ */ h(io, {
|
|
8472
8519
|
fill: Math.max(0, Math.min(1, e - r)),
|
|
8473
8520
|
size: t,
|
|
8474
8521
|
clipId: `${n}-${r}`
|
|
8475
8522
|
}, r))
|
|
8476
8523
|
});
|
|
8477
8524
|
}
|
|
8478
|
-
function
|
|
8525
|
+
function oo({ value: e, onChange: t, size: n = 28, label: r }) {
|
|
8479
8526
|
let i = c().replace(/:/g, ""), [a, o] = d(0), s = a || e;
|
|
8480
8527
|
return /* @__PURE__ */ h("span", {
|
|
8481
8528
|
role: "radiogroup",
|
|
@@ -8506,7 +8553,7 @@ function ro({ value: e, onChange: t, size: n = 28, label: r }) {
|
|
|
8506
8553
|
cursor: "pointer",
|
|
8507
8554
|
lineHeight: 0
|
|
8508
8555
|
},
|
|
8509
|
-
children: /* @__PURE__ */ h(
|
|
8556
|
+
children: /* @__PURE__ */ h(io, {
|
|
8510
8557
|
fill: +(s >= r),
|
|
8511
8558
|
size: n,
|
|
8512
8559
|
clipId: `${i}-${r}`
|
|
@@ -8514,8 +8561,8 @@ function ro({ value: e, onChange: t, size: n = 28, label: r }) {
|
|
|
8514
8561
|
}, r))
|
|
8515
8562
|
});
|
|
8516
8563
|
}
|
|
8517
|
-
function
|
|
8518
|
-
let { tenant: n, apiUrl: r, favoritesOn: i } =
|
|
8564
|
+
function so(e, { inert: t }) {
|
|
8565
|
+
let { tenant: n, apiUrl: r, favoritesOn: i } = eo(), [a, o] = d({
|
|
8519
8566
|
favorited: !1,
|
|
8520
8567
|
count: null
|
|
8521
8568
|
});
|
|
@@ -8555,7 +8602,7 @@ function io(e, { inert: t }) {
|
|
|
8555
8602
|
toggle: c
|
|
8556
8603
|
};
|
|
8557
8604
|
}
|
|
8558
|
-
var
|
|
8605
|
+
var co = (e) => /* @__PURE__ */ h("svg", {
|
|
8559
8606
|
width: "20",
|
|
8560
8607
|
height: "20",
|
|
8561
8608
|
viewBox: "0 0 24 24",
|
|
@@ -8568,8 +8615,8 @@ var ao = (e) => /* @__PURE__ */ h("svg", {
|
|
|
8568
8615
|
strokeWidth: "1.8"
|
|
8569
8616
|
})
|
|
8570
8617
|
});
|
|
8571
|
-
function
|
|
8572
|
-
let { locale: r, words: i, reviewsOn: a, questionsOn: o, favoritesOn: s, loginHref: c } =
|
|
8618
|
+
function lo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
8619
|
+
let { locale: r, words: i, reviewsOn: a, questionsOn: o, favoritesOn: s, loginHref: c } = eo(), l = e?.sample ? "" : e?.slug || e?.id || "", u = so(l, { inert: t || !l }), [f, p] = d(""), m = n ? 29 : e?.rating_count ?? 0, _ = n ? 4.3 : Number(e?.rating_avg ?? 0), v = n ? 110 : e?.questions_count ?? 0, y = n ? 1300 : u.count ?? e?.favorites_count ?? 0, b = (e) => (n) => {
|
|
8573
8620
|
n.preventDefault(), !t && document.getElementById(e)?.scrollIntoView({
|
|
8574
8621
|
behavior: "smooth",
|
|
8575
8622
|
block: "start"
|
|
@@ -8578,7 +8625,7 @@ function oo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
8578
8625
|
if (!(t || !l)) try {
|
|
8579
8626
|
await u.toggle();
|
|
8580
8627
|
} catch (e) {
|
|
8581
|
-
e?.code === "LOGIN_REQUIRED" ? window.location.assign(c()) : p(
|
|
8628
|
+
e?.code === "LOGIN_REQUIRED" ? window.location.assign(c()) : p(Ua(i, e));
|
|
8582
8629
|
}
|
|
8583
8630
|
}, S = [];
|
|
8584
8631
|
return a && m > 0 && S.push(/* @__PURE__ */ g("span", {
|
|
@@ -8596,13 +8643,13 @@ function oo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
8596
8643
|
maximumFractionDigits: 1
|
|
8597
8644
|
})
|
|
8598
8645
|
}),
|
|
8599
|
-
/* @__PURE__ */ h(
|
|
8646
|
+
/* @__PURE__ */ h(ao, { value: _ }),
|
|
8600
8647
|
/* @__PURE__ */ h("a", {
|
|
8601
8648
|
href: "#reviews",
|
|
8602
8649
|
onClick: b("reviews"),
|
|
8603
8650
|
...X("rating-link"),
|
|
8604
8651
|
style: { color: "inherit" },
|
|
8605
|
-
children: m === 1 ? i("reviewsOne") : i("reviewsCount", { n:
|
|
8652
|
+
children: m === 1 ? i("reviewsOne") : i("reviewsCount", { n: to(m, r) })
|
|
8606
8653
|
})
|
|
8607
8654
|
]
|
|
8608
8655
|
}, "r")), o && v > 0 && S.push(/* @__PURE__ */ h("a", {
|
|
@@ -8610,7 +8657,7 @@ function oo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
8610
8657
|
onClick: b("questions"),
|
|
8611
8658
|
...X("qa-link"),
|
|
8612
8659
|
style: { color: "inherit" },
|
|
8613
|
-
children: i("qaCount", { n:
|
|
8660
|
+
children: i("qaCount", { n: to(v, r) })
|
|
8614
8661
|
}, "q")), !S.length && !s ? null : /* @__PURE__ */ g("div", {
|
|
8615
8662
|
...X("engagement"),
|
|
8616
8663
|
style: {
|
|
@@ -8629,7 +8676,7 @@ function oo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
8629
8676
|
},
|
|
8630
8677
|
children: S.flatMap((e, t) => t ? [/* @__PURE__ */ h("span", {
|
|
8631
8678
|
...X("separator"),
|
|
8632
|
-
style: { color:
|
|
8679
|
+
style: { color: Ja },
|
|
8633
8680
|
children: "•"
|
|
8634
8681
|
}, `s${t}`), e] : [e])
|
|
8635
8682
|
}),
|
|
@@ -8647,22 +8694,22 @@ function oo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
8647
8694
|
"aria-label": u.favorited ? i("unfavorite") : i("favorite"),
|
|
8648
8695
|
title: u.favorited ? i("unfavorite") : i("favorite"),
|
|
8649
8696
|
style: {
|
|
8650
|
-
|
|
8697
|
+
...$a,
|
|
8651
8698
|
padding: "7px",
|
|
8652
8699
|
borderRadius: "999px",
|
|
8653
8700
|
lineHeight: 0
|
|
8654
8701
|
},
|
|
8655
|
-
children:
|
|
8702
|
+
children: co(u.favorited)
|
|
8656
8703
|
}), y > 0 && /* @__PURE__ */ h("span", {
|
|
8657
8704
|
...X("favorites-count"),
|
|
8658
8705
|
style: { fontWeight: 600 },
|
|
8659
|
-
children: y === 1 ? i("lovedByOne") : i("lovedBy", { n:
|
|
8706
|
+
children: y === 1 ? i("lovedByOne") : i("lovedBy", { n: to(y, r) })
|
|
8660
8707
|
})]
|
|
8661
8708
|
}),
|
|
8662
8709
|
f && /* @__PURE__ */ h("span", {
|
|
8663
8710
|
...X("note"),
|
|
8664
8711
|
style: {
|
|
8665
|
-
color:
|
|
8712
|
+
color: Ja,
|
|
8666
8713
|
fontSize: "13px"
|
|
8667
8714
|
},
|
|
8668
8715
|
children: f
|
|
@@ -8670,7 +8717,7 @@ function oo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
8670
8717
|
]
|
|
8671
8718
|
});
|
|
8672
8719
|
}
|
|
8673
|
-
var
|
|
8720
|
+
var uo = {
|
|
8674
8721
|
data: [{
|
|
8675
8722
|
id: "s1",
|
|
8676
8723
|
author: "Ayşe Y.",
|
|
@@ -8706,8 +8753,8 @@ var so = {
|
|
|
8706
8753
|
]
|
|
8707
8754
|
}
|
|
8708
8755
|
};
|
|
8709
|
-
function
|
|
8710
|
-
let { tenant: r, apiUrl: i, locale: a, words: o, reviewsOn: c, moderated: l, loginHref: u } =
|
|
8756
|
+
function fo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
8757
|
+
let { tenant: r, apiUrl: i, locale: a, words: o, reviewsOn: c, moderated: l, loginHref: u } = eo(), f = la(), p = e?.sample ? "" : e?.slug || e?.id || "", [m, _] = d(null), [v, y] = d("newest"), [b, x] = d(0), [S, C] = d(5), [w, T] = d(0), [E, D] = d({
|
|
8711
8758
|
rating: 0,
|
|
8712
8759
|
title: "",
|
|
8713
8760
|
body: ""
|
|
@@ -8745,7 +8792,7 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
8745
8792
|
w,
|
|
8746
8793
|
c
|
|
8747
8794
|
]), !c) return null;
|
|
8748
|
-
let P = n || !p ?
|
|
8795
|
+
let P = n || !p ? uo : m, F = P?.summary ?? {
|
|
8749
8796
|
average: 0,
|
|
8750
8797
|
count: 0,
|
|
8751
8798
|
histogram: [
|
|
@@ -8783,7 +8830,7 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
8783
8830
|
body: E
|
|
8784
8831
|
}), k(!1), N(o(l ? "reviewPending" : "reviewThanks")), T((e) => e + 1);
|
|
8785
8832
|
} catch (e) {
|
|
8786
|
-
e?.code === "LOGIN_REQUIRED" ? window.location.assign(u()) : N(
|
|
8833
|
+
e?.code === "LOGIN_REQUIRED" ? window.location.assign(u()) : N(Ua(o, e));
|
|
8787
8834
|
} finally {
|
|
8788
8835
|
j(!1);
|
|
8789
8836
|
}
|
|
@@ -8835,14 +8882,14 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
8835
8882
|
maximumFractionDigits: 1
|
|
8836
8883
|
}) : "–"
|
|
8837
8884
|
}),
|
|
8838
|
-
/* @__PURE__ */ h(
|
|
8885
|
+
/* @__PURE__ */ h(ao, {
|
|
8839
8886
|
value: F.average,
|
|
8840
8887
|
size: 18
|
|
8841
8888
|
}),
|
|
8842
8889
|
/* @__PURE__ */ h("span", {
|
|
8843
8890
|
...X("reviews-count"),
|
|
8844
8891
|
style: {
|
|
8845
|
-
color:
|
|
8892
|
+
color: Ja,
|
|
8846
8893
|
fontSize: "13px"
|
|
8847
8894
|
},
|
|
8848
8895
|
children: F.count === 1 ? o("reviewsOne") : o("reviewsCount", { n: F.count })
|
|
@@ -8894,7 +8941,7 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
8894
8941
|
style: {
|
|
8895
8942
|
height: "8px",
|
|
8896
8943
|
borderRadius: "4px",
|
|
8897
|
-
background:
|
|
8944
|
+
background: Xa,
|
|
8898
8945
|
overflow: "hidden"
|
|
8899
8946
|
},
|
|
8900
8947
|
children: /* @__PURE__ */ h("span", {
|
|
@@ -8903,13 +8950,13 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
8903
8950
|
display: "block",
|
|
8904
8951
|
height: "100%",
|
|
8905
8952
|
width: `${n / B * 100}%`,
|
|
8906
|
-
background:
|
|
8953
|
+
background: Za
|
|
8907
8954
|
}
|
|
8908
8955
|
})
|
|
8909
8956
|
}),
|
|
8910
8957
|
/* @__PURE__ */ h("span", {
|
|
8911
8958
|
style: {
|
|
8912
|
-
color:
|
|
8959
|
+
color: Ja,
|
|
8913
8960
|
textAlign: "right"
|
|
8914
8961
|
},
|
|
8915
8962
|
children: n
|
|
@@ -8924,7 +8971,7 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
8924
8971
|
type: "button",
|
|
8925
8972
|
onClick: R,
|
|
8926
8973
|
...X("review-button"),
|
|
8927
|
-
style:
|
|
8974
|
+
style: Qa,
|
|
8928
8975
|
children: o(L || t ? I ? "editReview" : "writeReview" : "signInToReview")
|
|
8929
8976
|
})
|
|
8930
8977
|
})
|
|
@@ -8938,7 +8985,7 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
8938
8985
|
flexDirection: "column",
|
|
8939
8986
|
gap: "10px",
|
|
8940
8987
|
padding: "16px",
|
|
8941
|
-
border:
|
|
8988
|
+
border: Ya,
|
|
8942
8989
|
borderRadius: "12px"
|
|
8943
8990
|
},
|
|
8944
8991
|
children: [
|
|
@@ -8950,7 +8997,7 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
8950
8997
|
gap: "12px",
|
|
8951
8998
|
fontWeight: 600
|
|
8952
8999
|
},
|
|
8953
|
-
children: [o("yourRating"), /* @__PURE__ */ h(
|
|
9000
|
+
children: [o("yourRating"), /* @__PURE__ */ h(oo, {
|
|
8954
9001
|
value: E.rating,
|
|
8955
9002
|
label: o("yourRating"),
|
|
8956
9003
|
onChange: (e) => D((t) => ({
|
|
@@ -8995,13 +9042,13 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
8995
9042
|
type: "submit",
|
|
8996
9043
|
disabled: A,
|
|
8997
9044
|
...X("submit-button"),
|
|
8998
|
-
style:
|
|
9045
|
+
style: Qa,
|
|
8999
9046
|
children: o("submitReview")
|
|
9000
9047
|
}), /* @__PURE__ */ h("button", {
|
|
9001
9048
|
type: "button",
|
|
9002
9049
|
onClick: () => k(!1),
|
|
9003
9050
|
...X("cancel-button"),
|
|
9004
|
-
style:
|
|
9051
|
+
style: $a,
|
|
9005
9052
|
children: "✕"
|
|
9006
9053
|
})]
|
|
9007
9054
|
})
|
|
@@ -9011,7 +9058,7 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9011
9058
|
...X("note"),
|
|
9012
9059
|
style: {
|
|
9013
9060
|
margin: 0,
|
|
9014
|
-
color:
|
|
9061
|
+
color: Ja
|
|
9015
9062
|
},
|
|
9016
9063
|
children: M
|
|
9017
9064
|
}),
|
|
@@ -9055,7 +9102,7 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9055
9102
|
onClick: () => x(0),
|
|
9056
9103
|
...X("filter-chip"),
|
|
9057
9104
|
style: {
|
|
9058
|
-
|
|
9105
|
+
...$a,
|
|
9059
9106
|
padding: "6px 12px"
|
|
9060
9107
|
},
|
|
9061
9108
|
children: [o("starsN", { n: b }), " ✕"]
|
|
@@ -9065,7 +9112,7 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9065
9112
|
...X("empty"),
|
|
9066
9113
|
style: {
|
|
9067
9114
|
margin: 0,
|
|
9068
|
-
color:
|
|
9115
|
+
color: Ja
|
|
9069
9116
|
},
|
|
9070
9117
|
children: o("noReviews")
|
|
9071
9118
|
}),
|
|
@@ -9078,7 +9125,7 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9078
9125
|
...X("review"),
|
|
9079
9126
|
style: {
|
|
9080
9127
|
padding: "16px 0",
|
|
9081
|
-
borderTop:
|
|
9128
|
+
borderTop: Ya,
|
|
9082
9129
|
display: "flex",
|
|
9083
9130
|
flexDirection: "column",
|
|
9084
9131
|
gap: "6px"
|
|
@@ -9092,7 +9139,7 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9092
9139
|
flexWrap: "wrap"
|
|
9093
9140
|
},
|
|
9094
9141
|
children: [
|
|
9095
|
-
/* @__PURE__ */ h(
|
|
9142
|
+
/* @__PURE__ */ h(ao, { value: e.rating }),
|
|
9096
9143
|
e.title && /* @__PURE__ */ h("strong", {
|
|
9097
9144
|
...X("review-title"),
|
|
9098
9145
|
children: e.title
|
|
@@ -9103,8 +9150,8 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9103
9150
|
fontSize: "12px",
|
|
9104
9151
|
padding: "2px 8px",
|
|
9105
9152
|
borderRadius: "999px",
|
|
9106
|
-
background:
|
|
9107
|
-
color:
|
|
9153
|
+
background: Xa,
|
|
9154
|
+
color: Ja
|
|
9108
9155
|
},
|
|
9109
9156
|
children: o("awaitingApproval")
|
|
9110
9157
|
})
|
|
@@ -9123,12 +9170,12 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9123
9170
|
...X("meta"),
|
|
9124
9171
|
style: {
|
|
9125
9172
|
fontSize: "13px",
|
|
9126
|
-
color:
|
|
9173
|
+
color: Ja
|
|
9127
9174
|
},
|
|
9128
9175
|
children: [
|
|
9129
9176
|
e.author || o("anonymous"),
|
|
9130
9177
|
" · ",
|
|
9131
|
-
|
|
9178
|
+
no(e.created_at, a),
|
|
9132
9179
|
e.verified && /* @__PURE__ */ g("span", {
|
|
9133
9180
|
...X("verified"),
|
|
9134
9181
|
style: {
|
|
@@ -9145,7 +9192,7 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9145
9192
|
marginTop: "4px",
|
|
9146
9193
|
padding: "10px 12px",
|
|
9147
9194
|
borderRadius: "8px",
|
|
9148
|
-
background:
|
|
9195
|
+
background: Xa,
|
|
9149
9196
|
fontSize: "14px"
|
|
9150
9197
|
},
|
|
9151
9198
|
children: [/* @__PURE__ */ h("strong", {
|
|
@@ -9153,7 +9200,7 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9153
9200
|
style: {
|
|
9154
9201
|
display: "block",
|
|
9155
9202
|
fontSize: "12px",
|
|
9156
|
-
color:
|
|
9203
|
+
color: Ja,
|
|
9157
9204
|
marginBottom: "2px"
|
|
9158
9205
|
},
|
|
9159
9206
|
children: o("shopReply")
|
|
@@ -9170,7 +9217,7 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9170
9217
|
onClick: () => C((e) => e + 10),
|
|
9171
9218
|
...X("load-more"),
|
|
9172
9219
|
style: {
|
|
9173
|
-
|
|
9220
|
+
...$a,
|
|
9174
9221
|
alignSelf: "center"
|
|
9175
9222
|
},
|
|
9176
9223
|
children: o("loadMore")
|
|
@@ -9178,7 +9225,7 @@ function co({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9178
9225
|
]
|
|
9179
9226
|
});
|
|
9180
9227
|
}
|
|
9181
|
-
var
|
|
9228
|
+
var po = {
|
|
9182
9229
|
data: [{
|
|
9183
9230
|
id: "q1",
|
|
9184
9231
|
author: "Can D.",
|
|
@@ -9191,8 +9238,8 @@ var lo = {
|
|
|
9191
9238
|
filtered: 1
|
|
9192
9239
|
}
|
|
9193
9240
|
};
|
|
9194
|
-
function
|
|
9195
|
-
let { tenant: r, apiUrl: i, locale: a, words: o, questionsOn: c, loginHref: l } =
|
|
9241
|
+
function mo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
9242
|
+
let { tenant: r, apiUrl: i, locale: a, words: o, questionsOn: c, loginHref: l } = eo(), u = la(), f = e?.sample ? "" : e?.slug || e?.id || "", [p, m] = d(null), [_, v] = d(5), [y, b] = d(0), [x, S] = d(""), [C, w] = d(!1), [T, E] = d("");
|
|
9196
9243
|
if (s(() => {
|
|
9197
9244
|
if (!c || !f) return;
|
|
9198
9245
|
let e = !0;
|
|
@@ -9213,7 +9260,7 @@ function uo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9213
9260
|
y,
|
|
9214
9261
|
c
|
|
9215
9262
|
]), !c) return null;
|
|
9216
|
-
let D = n || !f ?
|
|
9263
|
+
let D = n || !f ? po : p, O = u.status === "user", k = async (e) => {
|
|
9217
9264
|
if (e.preventDefault(), !(t || x.trim().length < 3)) {
|
|
9218
9265
|
if (!O) {
|
|
9219
9266
|
window.location.assign(l());
|
|
@@ -9226,7 +9273,7 @@ function uo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9226
9273
|
body: { question: x.trim() }
|
|
9227
9274
|
}), S(""), E(o("questionPending")), b((e) => e + 1);
|
|
9228
9275
|
} catch (e) {
|
|
9229
|
-
e?.code === "LOGIN_REQUIRED" ? window.location.assign(l()) : E(
|
|
9276
|
+
e?.code === "LOGIN_REQUIRED" ? window.location.assign(l()) : E(Ua(o, e));
|
|
9230
9277
|
} finally {
|
|
9231
9278
|
w(!1);
|
|
9232
9279
|
}
|
|
@@ -9272,7 +9319,7 @@ function uo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9272
9319
|
type: "submit",
|
|
9273
9320
|
disabled: C || x.trim().length < 3,
|
|
9274
9321
|
...X("submit-button"),
|
|
9275
|
-
style:
|
|
9322
|
+
style: Qa,
|
|
9276
9323
|
children: o("submitQuestion")
|
|
9277
9324
|
})]
|
|
9278
9325
|
}) : /* @__PURE__ */ h("p", {
|
|
@@ -9288,7 +9335,7 @@ function uo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9288
9335
|
...X("note"),
|
|
9289
9336
|
style: {
|
|
9290
9337
|
margin: 0,
|
|
9291
|
-
color:
|
|
9338
|
+
color: Ja
|
|
9292
9339
|
},
|
|
9293
9340
|
children: T
|
|
9294
9341
|
}),
|
|
@@ -9296,7 +9343,7 @@ function uo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9296
9343
|
...X("empty"),
|
|
9297
9344
|
style: {
|
|
9298
9345
|
margin: 0,
|
|
9299
|
-
color:
|
|
9346
|
+
color: Ja
|
|
9300
9347
|
},
|
|
9301
9348
|
children: o("noQuestions")
|
|
9302
9349
|
}),
|
|
@@ -9309,7 +9356,7 @@ function uo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9309
9356
|
...X("question"),
|
|
9310
9357
|
style: {
|
|
9311
9358
|
padding: "14px 0",
|
|
9312
|
-
borderTop:
|
|
9359
|
+
borderTop: Ya,
|
|
9313
9360
|
display: "flex",
|
|
9314
9361
|
flexDirection: "column",
|
|
9315
9362
|
gap: "6px"
|
|
@@ -9350,7 +9397,7 @@ function uo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9350
9397
|
...X("badge"),
|
|
9351
9398
|
style: {
|
|
9352
9399
|
fontSize: "12px",
|
|
9353
|
-
color:
|
|
9400
|
+
color: Ja
|
|
9354
9401
|
},
|
|
9355
9402
|
children: o("awaitingAnswer")
|
|
9356
9403
|
}),
|
|
@@ -9358,12 +9405,12 @@ function uo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9358
9405
|
...X("meta"),
|
|
9359
9406
|
style: {
|
|
9360
9407
|
fontSize: "12px",
|
|
9361
|
-
color:
|
|
9408
|
+
color: Ja
|
|
9362
9409
|
},
|
|
9363
9410
|
children: [
|
|
9364
9411
|
e.author || o("anonymous"),
|
|
9365
9412
|
" · ",
|
|
9366
|
-
|
|
9413
|
+
no(e.created_at, a)
|
|
9367
9414
|
]
|
|
9368
9415
|
})
|
|
9369
9416
|
]
|
|
@@ -9374,7 +9421,7 @@ function uo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9374
9421
|
onClick: () => v((e) => e + 10),
|
|
9375
9422
|
...X("load-more"),
|
|
9376
9423
|
style: {
|
|
9377
|
-
|
|
9424
|
+
...$a,
|
|
9378
9425
|
alignSelf: "center"
|
|
9379
9426
|
},
|
|
9380
9427
|
children: o("loadMore")
|
|
@@ -9384,8 +9431,8 @@ function uo({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
9384
9431
|
}
|
|
9385
9432
|
//#endregion
|
|
9386
9433
|
//#region ../ui/src/components/builder/apps/shop/specs.jsx
|
|
9387
|
-
var
|
|
9388
|
-
function
|
|
9434
|
+
var ho = "1px solid var(--page-border, #d1d5db)", go = "var(--page-muted, rgba(100,116,139,1))", _o = (e) => /^(https?:)?\/\//i.test(String(e)) || String(e).startsWith("/") ? String(e) : "";
|
|
9435
|
+
function vo(e, t, n, r) {
|
|
9389
9436
|
let i = n || void 0;
|
|
9390
9437
|
switch (e.type) {
|
|
9391
9438
|
case "integer":
|
|
@@ -9408,7 +9455,7 @@ function ho(e, t, n, r) {
|
|
|
9408
9455
|
gap: "6px"
|
|
9409
9456
|
},
|
|
9410
9457
|
children: [
|
|
9411
|
-
n === 5 && /* @__PURE__ */ h(
|
|
9458
|
+
n === 5 && /* @__PURE__ */ h(ao, { value: Number(t) }),
|
|
9412
9459
|
Number(t).toLocaleString(i),
|
|
9413
9460
|
" / ",
|
|
9414
9461
|
n
|
|
@@ -9440,12 +9487,12 @@ function ho(e, t, n, r) {
|
|
|
9440
9487
|
height: "14px",
|
|
9441
9488
|
borderRadius: "4px",
|
|
9442
9489
|
background: t,
|
|
9443
|
-
border:
|
|
9490
|
+
border: ho,
|
|
9444
9491
|
display: "inline-block"
|
|
9445
9492
|
} }), t]
|
|
9446
9493
|
});
|
|
9447
9494
|
case "link": {
|
|
9448
|
-
let e =
|
|
9495
|
+
let e = _o(t);
|
|
9449
9496
|
return e ? /* @__PURE__ */ h("a", {
|
|
9450
9497
|
href: e,
|
|
9451
9498
|
target: "_blank",
|
|
@@ -9454,7 +9501,7 @@ function ho(e, t, n, r) {
|
|
|
9454
9501
|
children: t
|
|
9455
9502
|
}) : String(t);
|
|
9456
9503
|
}
|
|
9457
|
-
case "image": return
|
|
9504
|
+
case "image": return _o(t) ? /* @__PURE__ */ h("img", {
|
|
9458
9505
|
src: t,
|
|
9459
9506
|
alt: e.name,
|
|
9460
9507
|
style: {
|
|
@@ -9465,14 +9512,14 @@ function ho(e, t, n, r) {
|
|
|
9465
9512
|
}
|
|
9466
9513
|
}) : "";
|
|
9467
9514
|
case "video":
|
|
9468
|
-
case "file": return
|
|
9515
|
+
case "file": return _o(t) ? /* @__PURE__ */ h("a", {
|
|
9469
9516
|
href: t,
|
|
9470
9517
|
target: "_blank",
|
|
9471
9518
|
rel: "noopener noreferrer",
|
|
9472
9519
|
style: { color: "var(--page-accent, #111827)" },
|
|
9473
9520
|
children: String(t).split("/").pop()
|
|
9474
9521
|
}) : "";
|
|
9475
|
-
case "media": return (Array.isArray(t) ? t : [t]).filter(
|
|
9522
|
+
case "media": return (Array.isArray(t) ? t : [t]).filter(_o).map((e, t) => /* @__PURE__ */ h("a", {
|
|
9476
9523
|
href: e,
|
|
9477
9524
|
target: "_blank",
|
|
9478
9525
|
rel: "noopener noreferrer",
|
|
@@ -9512,7 +9559,7 @@ function ho(e, t, n, r) {
|
|
|
9512
9559
|
default: return String(t);
|
|
9513
9560
|
}
|
|
9514
9561
|
}
|
|
9515
|
-
function
|
|
9562
|
+
function yo({ specs: e, locale: t, words: n }) {
|
|
9516
9563
|
return !Array.isArray(e) || !e.length ? null : /* @__PURE__ */ g("section", {
|
|
9517
9564
|
...X("specs"),
|
|
9518
9565
|
style: {
|
|
@@ -9531,7 +9578,7 @@ function go({ specs: e, locale: t, words: n }) {
|
|
|
9531
9578
|
role: "table",
|
|
9532
9579
|
...X("specs-table"),
|
|
9533
9580
|
style: {
|
|
9534
|
-
border:
|
|
9581
|
+
border: ho,
|
|
9535
9582
|
borderRadius: "10px",
|
|
9536
9583
|
overflow: "hidden"
|
|
9537
9584
|
},
|
|
@@ -9545,13 +9592,13 @@ function go({ specs: e, locale: t, words: n }) {
|
|
|
9545
9592
|
gridTemplateColumns: "minmax(120px, 34%) 1fr",
|
|
9546
9593
|
gap: "16px",
|
|
9547
9594
|
padding: "10px 14px",
|
|
9548
|
-
borderTop: r ?
|
|
9595
|
+
borderTop: r ? ho : 0,
|
|
9549
9596
|
fontSize: "14px"
|
|
9550
9597
|
},
|
|
9551
9598
|
children: [/* @__PURE__ */ h("span", {
|
|
9552
9599
|
role: "rowheader",
|
|
9553
9600
|
...X("spec-name"),
|
|
9554
|
-
style: { color:
|
|
9601
|
+
style: { color: go },
|
|
9555
9602
|
children: e.name
|
|
9556
9603
|
}), /* @__PURE__ */ h("span", {
|
|
9557
9604
|
role: "cell",
|
|
@@ -9562,7 +9609,7 @@ function go({ specs: e, locale: t, words: n }) {
|
|
|
9562
9609
|
gap: "4px 10px",
|
|
9563
9610
|
alignItems: "center"
|
|
9564
9611
|
},
|
|
9565
|
-
children: i.map((r, a) => /* @__PURE__ */ g("span", { children: [
|
|
9612
|
+
children: i.map((r, a) => /* @__PURE__ */ g("span", { children: [vo(e, r, t, n), a < i.length - 1 && e.type !== "color" ? "," : ""] }, a))
|
|
9566
9613
|
})]
|
|
9567
9614
|
}, e.key);
|
|
9568
9615
|
})
|
|
@@ -9571,7 +9618,7 @@ function go({ specs: e, locale: t, words: n }) {
|
|
|
9571
9618
|
}
|
|
9572
9619
|
//#endregion
|
|
9573
9620
|
//#region ../ui/src/components/builder/apps/shop/views.jsx
|
|
9574
|
-
var $ = "var(--page-muted, rgba(100,116,139,1))",
|
|
9621
|
+
var $ = "var(--page-muted, rgba(100,116,139,1))", bo = "1px solid var(--page-border, #d1d5db)", xo = "var(--page-surface, #f2f2f2)", So = {
|
|
9575
9622
|
...an,
|
|
9576
9623
|
border: 0,
|
|
9577
9624
|
borderRadius: "8px",
|
|
@@ -9580,14 +9627,14 @@ var $ = "var(--page-muted, rgba(100,116,139,1))", _o = "1px solid var(--page-bor
|
|
|
9580
9627
|
fontWeight: 600,
|
|
9581
9628
|
fontFamily: "inherit",
|
|
9582
9629
|
textAlign: "center"
|
|
9583
|
-
},
|
|
9584
|
-
...
|
|
9630
|
+
}, Co = {
|
|
9631
|
+
...So,
|
|
9585
9632
|
backgroundColor: "transparent",
|
|
9586
9633
|
color: "var(--page-text, #111827)",
|
|
9587
|
-
border:
|
|
9634
|
+
border: bo
|
|
9588
9635
|
};
|
|
9589
|
-
function
|
|
9590
|
-
let { tenant: e, apiUrl: t, locale: n, param: r, settings: i } = o(Y), s = l(() =>
|
|
9636
|
+
function wo() {
|
|
9637
|
+
let { tenant: e, apiUrl: t, locale: n, param: r, settings: i } = o(Y), s = l(() => Ha(n), [n]), c = i?.["shop.orderPrefix"], u = i?.["shop.orderSuffix"], d = a((e) => `${typeof c == "string" ? c : "#"}${e}${typeof u == "string" ? u : ""}`, [c, u]);
|
|
9591
9638
|
return {
|
|
9592
9639
|
tenant: e,
|
|
9593
9640
|
apiUrl: t || "/api",
|
|
@@ -9597,8 +9644,8 @@ function xo() {
|
|
|
9597
9644
|
orderId: d
|
|
9598
9645
|
};
|
|
9599
9646
|
}
|
|
9600
|
-
function
|
|
9601
|
-
let r = l(() =>
|
|
9647
|
+
function To(e, t, n = !0) {
|
|
9648
|
+
let r = l(() => Ia(e, t), [e, t]), i = f(r.subscribe, r.getState, r.getState);
|
|
9602
9649
|
return s(() => {
|
|
9603
9650
|
n && !i.loaded && !i.loading && r.load();
|
|
9604
9651
|
}, [n, r]), {
|
|
@@ -9606,8 +9653,8 @@ function So(e, t, n = !0) {
|
|
|
9606
9653
|
...i
|
|
9607
9654
|
};
|
|
9608
9655
|
}
|
|
9609
|
-
var
|
|
9610
|
-
function
|
|
9656
|
+
var Eo = (e) => typeof window > "u" ? "" : new URLSearchParams(window.location.search).get(e) ?? "";
|
|
9657
|
+
function Do({ value: e, label: t, onCommit: n }) {
|
|
9611
9658
|
let [r, i] = d(null), a = () => {
|
|
9612
9659
|
if (r === null) return;
|
|
9613
9660
|
let t = Math.max(1, Math.round(Number(r)) || 1);
|
|
@@ -9631,12 +9678,12 @@ function wo({ value: e, label: t, onCommit: n }) {
|
|
|
9631
9678
|
}
|
|
9632
9679
|
});
|
|
9633
9680
|
}
|
|
9634
|
-
var
|
|
9635
|
-
function
|
|
9681
|
+
var Oo = "/product/{slug}", ko = (e) => !e || e === "/product?product={slug}" ? Oo : e, Ao = (e, t) => String(ko(e)).replace(/\{slug\}/g, encodeURIComponent(t.slug)).replace(/\{id\}/g, t.id);
|
|
9682
|
+
function jo(e) {
|
|
9636
9683
|
let t = e.variants?.length ? e.variants.map((e) => e.stock) : [e.stock];
|
|
9637
9684
|
return t.some((e) => e == null) ? null : t.reduce((e, t) => e + Number(t), 0);
|
|
9638
9685
|
}
|
|
9639
|
-
function
|
|
9686
|
+
function Mo({ product: e, variant: t, locale: n, size: r = 16 }) {
|
|
9640
9687
|
let i = e.currency, a = t?.price ?? e.price;
|
|
9641
9688
|
return /* @__PURE__ */ g("span", {
|
|
9642
9689
|
...X("price"),
|
|
@@ -9649,7 +9696,7 @@ function ko({ product: e, variant: t, locale: n, size: r = 16 }) {
|
|
|
9649
9696
|
children: [/* @__PURE__ */ h("span", {
|
|
9650
9697
|
...X("price-current"),
|
|
9651
9698
|
style: { fontWeight: 700 },
|
|
9652
|
-
children:
|
|
9699
|
+
children: Ba(a, i, n)
|
|
9653
9700
|
}), e.compare_at_price > a && /* @__PURE__ */ h("span", {
|
|
9654
9701
|
...X("price-old"),
|
|
9655
9702
|
style: {
|
|
@@ -9657,11 +9704,11 @@ function ko({ product: e, variant: t, locale: n, size: r = 16 }) {
|
|
|
9657
9704
|
textDecoration: "line-through",
|
|
9658
9705
|
fontSize: "0.85em"
|
|
9659
9706
|
},
|
|
9660
|
-
children:
|
|
9707
|
+
children: Ba(e.compare_at_price, i, n)
|
|
9661
9708
|
})]
|
|
9662
9709
|
});
|
|
9663
9710
|
}
|
|
9664
|
-
var
|
|
9711
|
+
var No = [
|
|
9665
9712
|
1,
|
|
9666
9713
|
2,
|
|
9667
9714
|
3
|
|
@@ -9677,8 +9724,8 @@ var Ao = [
|
|
|
9677
9724
|
currency: "USD",
|
|
9678
9725
|
sample: !0
|
|
9679
9726
|
}));
|
|
9680
|
-
function
|
|
9681
|
-
let { tenant: y, apiUrl: b, locale: x, words: S } =
|
|
9727
|
+
function Po({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/product/{slug}", showButton: i = !0, buttonLabel: a = "", emptyText: o = "", collection: c = "", source: l = "catalog", loginHref: u = "", style: f, nodeRef: p, inert: m = !1, sample: _ = !1, noNavigate: v = !1 }) {
|
|
9728
|
+
let { tenant: y, apiUrl: b, locale: x, words: S } = wo(), C = eo(), [w, T] = d(null), [E, D] = d(null), [O, k] = d(""), [A, j] = d({}), [M, N] = d(!1), { store: P, currency: F } = To(b, y, !m), I = l === "favorites";
|
|
9682
9729
|
s(() => {
|
|
9683
9730
|
let e = !0, n = Math.max(1, Math.min(100, Number(t) || 12)), r = F ? `¤cy=${encodeURIComponent(F)}` : "";
|
|
9684
9731
|
if (I && m) {
|
|
@@ -9687,7 +9734,7 @@ function jo({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
|
|
|
9687
9734
|
}
|
|
9688
9735
|
return N(!1), Promise.all([Q(b, y, I ? `/store/my/favorites?limit=${n}${r}` : `/store/products?limit=${n}${r}${c ? `&collection=${encodeURIComponent(c)}` : ""}`), Q(b, y, "/store/config")]).then(([t, n]) => {
|
|
9689
9736
|
if (!e) return;
|
|
9690
|
-
let r =
|
|
9737
|
+
let r = La(n, F);
|
|
9691
9738
|
D(n), T(Array.isArray(t?.data) ? t.data.map((e) => ({
|
|
9692
9739
|
...e,
|
|
9693
9740
|
currency: r
|
|
@@ -9706,7 +9753,7 @@ function jo({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
|
|
|
9706
9753
|
I,
|
|
9707
9754
|
m
|
|
9708
9755
|
]);
|
|
9709
|
-
let L = w?.length || !_ ? w ?? [] :
|
|
9756
|
+
let L = w?.length || !_ ? w ?? [] : No, R = async (e) => {
|
|
9710
9757
|
if (!(m || e.sample)) {
|
|
9711
9758
|
k(e.id);
|
|
9712
9759
|
try {
|
|
@@ -9717,7 +9764,7 @@ function jo({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
|
|
|
9717
9764
|
} catch (t) {
|
|
9718
9765
|
j((n) => ({
|
|
9719
9766
|
...n,
|
|
9720
|
-
[e.id]:
|
|
9767
|
+
[e.id]: Ua(S, t)
|
|
9721
9768
|
}));
|
|
9722
9769
|
} finally {
|
|
9723
9770
|
k("");
|
|
@@ -9762,7 +9809,7 @@ function jo({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
|
|
|
9762
9809
|
gap: `${n}px`
|
|
9763
9810
|
},
|
|
9764
9811
|
children: L.map((e) => {
|
|
9765
|
-
let t =
|
|
9812
|
+
let t = jo(e) === 0, n = Ao(r, e);
|
|
9766
9813
|
return /* @__PURE__ */ g("div", {
|
|
9767
9814
|
...X("card"),
|
|
9768
9815
|
style: {
|
|
@@ -9785,7 +9832,7 @@ function jo({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
|
|
|
9785
9832
|
aspectRatio: "1 / 1",
|
|
9786
9833
|
borderRadius: "10px",
|
|
9787
9834
|
overflow: "hidden",
|
|
9788
|
-
background:
|
|
9835
|
+
background: xo
|
|
9789
9836
|
},
|
|
9790
9837
|
children: e.images?.[0] && /* @__PURE__ */ h("img", {
|
|
9791
9838
|
src: e.images[0],
|
|
@@ -9818,16 +9865,16 @@ function jo({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
|
|
|
9818
9865
|
color: $
|
|
9819
9866
|
},
|
|
9820
9867
|
children: [
|
|
9821
|
-
/* @__PURE__ */ h(
|
|
9868
|
+
/* @__PURE__ */ h(ao, {
|
|
9822
9869
|
value: Number(e.rating_avg),
|
|
9823
9870
|
size: 14
|
|
9824
9871
|
}),
|
|
9825
9872
|
"(",
|
|
9826
|
-
|
|
9873
|
+
to(e.rating_count, x),
|
|
9827
9874
|
")"
|
|
9828
9875
|
]
|
|
9829
9876
|
}),
|
|
9830
|
-
/* @__PURE__ */ h(
|
|
9877
|
+
/* @__PURE__ */ h(Mo, {
|
|
9831
9878
|
product: e,
|
|
9832
9879
|
locale: x
|
|
9833
9880
|
}),
|
|
@@ -9836,7 +9883,7 @@ function jo({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
|
|
|
9836
9883
|
onClick: v ? (e) => e.preventDefault() : void 0,
|
|
9837
9884
|
...X("choose-button"),
|
|
9838
9885
|
style: {
|
|
9839
|
-
...
|
|
9886
|
+
...Co,
|
|
9840
9887
|
display: "block"
|
|
9841
9888
|
},
|
|
9842
9889
|
children: S("choose")
|
|
@@ -9846,7 +9893,7 @@ function jo({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
|
|
|
9846
9893
|
onClick: () => R(e),
|
|
9847
9894
|
...X("add-button", t && "add-button-sold-out"),
|
|
9848
9895
|
style: {
|
|
9849
|
-
...
|
|
9896
|
+
...So,
|
|
9850
9897
|
opacity: t ? .5 : 1
|
|
9851
9898
|
},
|
|
9852
9899
|
children: t ? S("soldOut") : O === e.id ? S("adding") : a || S("add")
|
|
@@ -9866,24 +9913,24 @@ function jo({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
|
|
|
9866
9913
|
]
|
|
9867
9914
|
});
|
|
9868
9915
|
}
|
|
9869
|
-
function
|
|
9870
|
-
let { tenant: f, apiUrl: p, locale: m, param: _, words: v } =
|
|
9916
|
+
function Fo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuestions: r = !0, showSpecs: i = !0, style: a, nodeRef: o, inert: c = !1, sample: l = !1, noNavigate: u = !1 }) {
|
|
9917
|
+
let { tenant: f, apiUrl: p, locale: m, param: _, words: v } = wo(), [y, b] = d(null), [x, S] = d(!1), [C, w] = d(0), [T, E] = d(""), [D, O] = d(1), [k, A] = d(!1), [j, M] = d(""), { store: N, currency: P } = To(p, f, !c), F = e || _ || Eo("product"), I = P ? `?currency=${encodeURIComponent(P)}` : "";
|
|
9871
9918
|
if (s(() => {
|
|
9872
9919
|
let e = !0;
|
|
9873
9920
|
return S(!1), (async () => {
|
|
9874
9921
|
let t = await Q(p, f, "/store/config"), n = F ? await Q(p, f, `/store/products/${encodeURIComponent(F)}${I}`) : l || u ? (await Q(p, f, `/store/products?limit=1${P ? `¤cy=${encodeURIComponent(P)}` : ""}`))?.data?.[0] : null;
|
|
9875
9922
|
if (e) {
|
|
9876
9923
|
if (!n) {
|
|
9877
|
-
S(!0), b(l ?
|
|
9924
|
+
S(!0), b(l ? No[0] : null);
|
|
9878
9925
|
return;
|
|
9879
9926
|
}
|
|
9880
9927
|
b({
|
|
9881
9928
|
...n,
|
|
9882
|
-
currency:
|
|
9929
|
+
currency: La(t, P)
|
|
9883
9930
|
}), E((e) => n.variants?.some((t) => t.id === e) ? e : n.variants?.[0]?.id ?? ""), w(0);
|
|
9884
9931
|
}
|
|
9885
9932
|
})().catch(() => {
|
|
9886
|
-
e && (S(!0), b(l ?
|
|
9933
|
+
e && (S(!0), b(l ? No[0] : null));
|
|
9887
9934
|
}), () => {
|
|
9888
9935
|
e = !1;
|
|
9889
9936
|
};
|
|
@@ -9910,7 +9957,7 @@ function Mo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
|
|
|
9910
9957
|
try {
|
|
9911
9958
|
await N.add(y.id, L?.id ?? null, Math.max(1, Number(D) || 1)), M(v("added"));
|
|
9912
9959
|
} catch (e) {
|
|
9913
|
-
M(
|
|
9960
|
+
M(Ua(v, e));
|
|
9914
9961
|
} finally {
|
|
9915
9962
|
A(!1);
|
|
9916
9963
|
}
|
|
@@ -9945,7 +9992,7 @@ function Mo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
|
|
|
9945
9992
|
aspectRatio: "1 / 1",
|
|
9946
9993
|
borderRadius: "12px",
|
|
9947
9994
|
overflow: "hidden",
|
|
9948
|
-
background:
|
|
9995
|
+
background: xo
|
|
9949
9996
|
},
|
|
9950
9997
|
children: y.images?.[C] && /* @__PURE__ */ h("img", {
|
|
9951
9998
|
src: y.images[C],
|
|
@@ -9976,8 +10023,8 @@ function Mo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
|
|
|
9976
10023
|
borderRadius: "8px",
|
|
9977
10024
|
overflow: "hidden",
|
|
9978
10025
|
cursor: "pointer",
|
|
9979
|
-
border: t === C ? "2px solid var(--page-accent, #111827)" :
|
|
9980
|
-
background:
|
|
10026
|
+
border: t === C ? "2px solid var(--page-accent, #111827)" : bo,
|
|
10027
|
+
background: xo
|
|
9981
10028
|
},
|
|
9982
10029
|
children: /* @__PURE__ */ h("img", {
|
|
9983
10030
|
src: e,
|
|
@@ -10008,12 +10055,12 @@ function Mo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
|
|
|
10008
10055
|
},
|
|
10009
10056
|
children: y.name
|
|
10010
10057
|
}),
|
|
10011
|
-
/* @__PURE__ */ h(
|
|
10058
|
+
/* @__PURE__ */ h(lo, {
|
|
10012
10059
|
product: y,
|
|
10013
10060
|
inert: c,
|
|
10014
10061
|
sample: l && !!y.sample
|
|
10015
10062
|
}),
|
|
10016
|
-
/* @__PURE__ */ h(
|
|
10063
|
+
/* @__PURE__ */ h(Mo, {
|
|
10017
10064
|
product: y,
|
|
10018
10065
|
variant: L,
|
|
10019
10066
|
locale: m,
|
|
@@ -10034,7 +10081,7 @@ function Mo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
|
|
|
10034
10081
|
onClick: () => E(e.id),
|
|
10035
10082
|
...X("variant", e.id === T && "variant-selected", t && "variant-sold-out"),
|
|
10036
10083
|
style: {
|
|
10037
|
-
...
|
|
10084
|
+
...Co,
|
|
10038
10085
|
padding: "8px 14px",
|
|
10039
10086
|
opacity: t ? .45 : 1,
|
|
10040
10087
|
textDecoration: t ? "line-through" : "none",
|
|
@@ -10069,7 +10116,7 @@ function Mo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
|
|
|
10069
10116
|
onClick: B,
|
|
10070
10117
|
...X("add-button", z && "add-button-sold-out"),
|
|
10071
10118
|
style: {
|
|
10072
|
-
...
|
|
10119
|
+
...So,
|
|
10073
10120
|
flex: 1,
|
|
10074
10121
|
opacity: z ? .5 : 1
|
|
10075
10122
|
},
|
|
@@ -10100,17 +10147,17 @@ function Mo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
|
|
|
10100
10147
|
]
|
|
10101
10148
|
})]
|
|
10102
10149
|
}),
|
|
10103
|
-
i && /* @__PURE__ */ h(
|
|
10150
|
+
i && /* @__PURE__ */ h(yo, {
|
|
10104
10151
|
specs: y.specs,
|
|
10105
10152
|
locale: m,
|
|
10106
10153
|
words: v
|
|
10107
10154
|
}),
|
|
10108
|
-
n && /* @__PURE__ */ h(
|
|
10155
|
+
n && /* @__PURE__ */ h(fo, {
|
|
10109
10156
|
product: y,
|
|
10110
10157
|
inert: c,
|
|
10111
10158
|
sample: l && !!y.sample
|
|
10112
10159
|
}),
|
|
10113
|
-
r && /* @__PURE__ */ h(
|
|
10160
|
+
r && /* @__PURE__ */ h(mo, {
|
|
10114
10161
|
product: y,
|
|
10115
10162
|
inert: c,
|
|
10116
10163
|
sample: l && !!y.sample
|
|
@@ -10118,13 +10165,13 @@ function Mo({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
|
|
|
10118
10165
|
]
|
|
10119
10166
|
});
|
|
10120
10167
|
}
|
|
10121
|
-
function
|
|
10122
|
-
return /* @__PURE__ */ h(
|
|
10168
|
+
function Io(e) {
|
|
10169
|
+
return /* @__PURE__ */ h(Po, {
|
|
10123
10170
|
...e,
|
|
10124
10171
|
source: "favorites"
|
|
10125
10172
|
});
|
|
10126
10173
|
}
|
|
10127
|
-
var
|
|
10174
|
+
var Lo = /* @__PURE__ */ g("svg", {
|
|
10128
10175
|
width: "20",
|
|
10129
10176
|
height: "20",
|
|
10130
10177
|
viewBox: "0 0 24 24",
|
|
@@ -10137,8 +10184,8 @@ var Po = /* @__PURE__ */ g("svg", {
|
|
|
10137
10184
|
...X("icon"),
|
|
10138
10185
|
children: [/* @__PURE__ */ h("path", { d: "M6 7h12l-1 13H7L6 7Z" }), /* @__PURE__ */ h("path", { d: "M9 7a3 3 0 0 1 6 0" })]
|
|
10139
10186
|
});
|
|
10140
|
-
function
|
|
10141
|
-
let { tenant: c, apiUrl: l, words: u } =
|
|
10187
|
+
function Ro({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nodeRef: i, inert: a = !1, sample: o = !1, noNavigate: s = !1 }) {
|
|
10188
|
+
let { tenant: c, apiUrl: l, words: u } = wo(), { cart: d } = To(l, c, !a), f = o && !d.count ? 2 : d.count;
|
|
10142
10189
|
return /* @__PURE__ */ g("a", {
|
|
10143
10190
|
ref: i,
|
|
10144
10191
|
href: e,
|
|
@@ -10155,7 +10202,7 @@ function Fo({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
|
|
|
10155
10202
|
...U(r)
|
|
10156
10203
|
},
|
|
10157
10204
|
children: [
|
|
10158
|
-
|
|
10205
|
+
Lo,
|
|
10159
10206
|
n && /* @__PURE__ */ h("span", {
|
|
10160
10207
|
...X("label"),
|
|
10161
10208
|
children: t || u("cart")
|
|
@@ -10183,7 +10230,7 @@ function Fo({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
|
|
|
10183
10230
|
]
|
|
10184
10231
|
});
|
|
10185
10232
|
}
|
|
10186
|
-
function
|
|
10233
|
+
function zo(e, t, n) {
|
|
10187
10234
|
if (t === "code") return e;
|
|
10188
10235
|
try {
|
|
10189
10236
|
if (t === "name") return `${new Intl.DisplayNames([n || "en"], { type: "currency" }).of(e) ?? e} (${e})`;
|
|
@@ -10196,8 +10243,8 @@ function Io(e, t, n) {
|
|
|
10196
10243
|
return e;
|
|
10197
10244
|
}
|
|
10198
10245
|
}
|
|
10199
|
-
function
|
|
10200
|
-
let { tenant: a, apiUrl: o, locale: c } =
|
|
10246
|
+
function Bo({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert: i = !1 }) {
|
|
10247
|
+
let { tenant: a, apiUrl: o, locale: c } = wo(), { store: l, currency: u } = To(o, a, !i), [f, p] = d(null), m = {
|
|
10201
10248
|
display: "inline-flex",
|
|
10202
10249
|
alignItems: "center",
|
|
10203
10250
|
gap: 8,
|
|
@@ -10231,7 +10278,7 @@ function Lo({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
|
|
|
10231
10278
|
}) : null, /* @__PURE__ */ h("select", {
|
|
10232
10279
|
"aria-label": t || "Currency",
|
|
10233
10280
|
...X("select"),
|
|
10234
|
-
value:
|
|
10281
|
+
value: La(f, u),
|
|
10235
10282
|
onChange: i ? void 0 : (e) => l.setCurrency(e.target.value === f.currency ? "" : e.target.value),
|
|
10236
10283
|
onKeyDown: i ? (e) => e.preventDefault() : void 0,
|
|
10237
10284
|
style: {
|
|
@@ -10245,24 +10292,24 @@ function Lo({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
|
|
|
10245
10292
|
},
|
|
10246
10293
|
children: _.map((t) => /* @__PURE__ */ h("option", {
|
|
10247
10294
|
value: t,
|
|
10248
|
-
children:
|
|
10295
|
+
children: zo(t, e, c)
|
|
10249
10296
|
}, t))
|
|
10250
10297
|
})]
|
|
10251
10298
|
});
|
|
10252
10299
|
}
|
|
10253
|
-
var
|
|
10300
|
+
var Vo = {
|
|
10254
10301
|
display: "flex",
|
|
10255
10302
|
flexDirection: "column",
|
|
10256
10303
|
gap: "6px",
|
|
10257
10304
|
fontSize: "13px"
|
|
10258
|
-
},
|
|
10305
|
+
}, Ho = {
|
|
10259
10306
|
margin: "0 0 12px",
|
|
10260
10307
|
fontSize: "18px"
|
|
10261
10308
|
};
|
|
10262
|
-
function
|
|
10309
|
+
function Uo({ label: e, required: t, children: n }) {
|
|
10263
10310
|
return /* @__PURE__ */ g("label", {
|
|
10264
10311
|
...X("field"),
|
|
10265
|
-
style:
|
|
10312
|
+
style: Vo,
|
|
10266
10313
|
children: [/* @__PURE__ */ g("span", {
|
|
10267
10314
|
...X("field-label"),
|
|
10268
10315
|
style: { fontWeight: 500 },
|
|
@@ -10274,7 +10321,7 @@ function Bo({ label: e, required: t, children: n }) {
|
|
|
10274
10321
|
}), n]
|
|
10275
10322
|
});
|
|
10276
10323
|
}
|
|
10277
|
-
var
|
|
10324
|
+
var Wo = [{
|
|
10278
10325
|
id: "ship:standard",
|
|
10279
10326
|
type: "shipping",
|
|
10280
10327
|
name: "Standard",
|
|
@@ -10290,7 +10337,7 @@ var Vo = [{
|
|
|
10290
10337
|
min_days: null,
|
|
10291
10338
|
max_days: null,
|
|
10292
10339
|
detail: "Main Street 1"
|
|
10293
|
-
}],
|
|
10340
|
+
}], Go = {
|
|
10294
10341
|
name: "",
|
|
10295
10342
|
email: "",
|
|
10296
10343
|
phone: "",
|
|
@@ -10305,8 +10352,8 @@ var Vo = [{
|
|
|
10305
10352
|
recipient: "",
|
|
10306
10353
|
gift_message: ""
|
|
10307
10354
|
};
|
|
10308
|
-
function
|
|
10309
|
-
let { tenant: o, apiUrl: c, locale: u, words: f, orderId: p } =
|
|
10355
|
+
function Ko({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample: i = !1, noNavigate: a = !1 }) {
|
|
10356
|
+
let { tenant: o, apiUrl: c, locale: u, words: f, orderId: p } = wo(), { store: m, cart: _, loaded: v } = To(c, o, !r), [y, b] = d(null), [x, S] = d(Go), [C, w] = d(""), [T, E] = d(!1), [D, O] = d(""), [k, A] = d(null), [j, M] = d(""), [N, P] = d(!1), F = !r && Eo("cancelled") === "1", I = (e) => Ba(e, _.currency || y?.currency, u);
|
|
10310
10357
|
s(() => {
|
|
10311
10358
|
Q(c, o, "/store/config").then((e) => {
|
|
10312
10359
|
b(e), w((t) => t || e?.methods?.[0] || "");
|
|
@@ -10315,15 +10362,15 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10315
10362
|
methods: []
|
|
10316
10363
|
}));
|
|
10317
10364
|
}, [c, o]), s(() => {
|
|
10318
|
-
let e =
|
|
10365
|
+
let e = Eo("order");
|
|
10319
10366
|
r || !e || F || Q(c, o, `/store/orders/${encodeURIComponent(e)}`).then((e) => {
|
|
10320
10367
|
A(e), e?.payment_status === "paid" && m.reset();
|
|
10321
|
-
}).catch((e) => O(
|
|
10368
|
+
}).catch((e) => O(Ua(f, e)));
|
|
10322
10369
|
}, [c, o]);
|
|
10323
10370
|
let L = (e) => (t) => S((n) => ({
|
|
10324
10371
|
...n,
|
|
10325
10372
|
[e]: t.target.value
|
|
10326
|
-
})), R = l(() =>
|
|
10373
|
+
})), R = l(() => za(u, y?.zone_countries ?? [], y && !y.ships_elsewhere && y.zone_countries?.length ? y.zone_countries : null), [u, y]);
|
|
10327
10374
|
s(() => {
|
|
10328
10375
|
_.country && !x.country && S((e) => ({
|
|
10329
10376
|
...e,
|
|
@@ -10336,7 +10383,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10336
10383
|
try {
|
|
10337
10384
|
await m.setCoupon(e), M("");
|
|
10338
10385
|
} catch (e) {
|
|
10339
|
-
O(
|
|
10386
|
+
O(Ua(f, e));
|
|
10340
10387
|
} finally {
|
|
10341
10388
|
P(!1);
|
|
10342
10389
|
}
|
|
@@ -10393,13 +10440,13 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10393
10440
|
}
|
|
10394
10441
|
A(t?.order ?? null), m.reset();
|
|
10395
10442
|
} catch (e) {
|
|
10396
|
-
O(
|
|
10443
|
+
O(Ua(f, e));
|
|
10397
10444
|
} finally {
|
|
10398
10445
|
E(!1);
|
|
10399
10446
|
}
|
|
10400
10447
|
}
|
|
10401
|
-
}, V = { ...U(t) }, H = r && i && !_.lines.length ? !0 : _.requires_shipping !== !1, ee = Array.isArray(_.discounts) ? _.discounts : [], W = ee.filter((e) => e.type !== "shipping"), te = ee.find((e) => e.type === "shipping") ?? null, ne = r && i && !_.lines.length ?
|
|
10402
|
-
r || e === _.delivery || (O(""), m.setDelivery(e).catch((e) => O(
|
|
10448
|
+
}, V = { ...U(t) }, H = r && i && !_.lines.length ? !0 : _.requires_shipping !== !1, ee = Array.isArray(_.discounts) ? _.discounts : [], W = ee.filter((e) => e.type !== "shipping"), te = ee.find((e) => e.type === "shipping") ?? null, ne = r && i && !_.lines.length ? Wo : Array.isArray(_.delivery_options) ? _.delivery_options : [], G = ne.find((e) => e.id === _.delivery) ?? (r && i ? ne[0] : null), K = G?.type === "pickup", re = (e) => {
|
|
10449
|
+
r || e === _.delivery || (O(""), m.setDelivery(e).catch((e) => O(Ua(f, e))));
|
|
10403
10450
|
};
|
|
10404
10451
|
if (k) {
|
|
10405
10452
|
let t = k.payment_status === "paid";
|
|
@@ -10427,7 +10474,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10427
10474
|
style: {
|
|
10428
10475
|
padding: "12px",
|
|
10429
10476
|
borderRadius: "8px",
|
|
10430
|
-
background:
|
|
10477
|
+
background: xo
|
|
10431
10478
|
},
|
|
10432
10479
|
children: Dn(k.instructions_content)
|
|
10433
10480
|
}) : k.instructions ? /* @__PURE__ */ h("pre", {
|
|
@@ -10436,7 +10483,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10436
10483
|
margin: 0,
|
|
10437
10484
|
padding: "12px",
|
|
10438
10485
|
borderRadius: "8px",
|
|
10439
|
-
background:
|
|
10486
|
+
background: xo,
|
|
10440
10487
|
whiteSpace: "pre-wrap",
|
|
10441
10488
|
fontFamily: "inherit"
|
|
10442
10489
|
},
|
|
@@ -10447,7 +10494,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10447
10494
|
style: {
|
|
10448
10495
|
padding: "12px",
|
|
10449
10496
|
borderRadius: "8px",
|
|
10450
|
-
background:
|
|
10497
|
+
background: xo
|
|
10451
10498
|
},
|
|
10452
10499
|
children: [
|
|
10453
10500
|
/* @__PURE__ */ h("div", {
|
|
@@ -10471,13 +10518,13 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10471
10518
|
/* @__PURE__ */ h("div", { children: f("pickupNote") })
|
|
10472
10519
|
]
|
|
10473
10520
|
}),
|
|
10474
|
-
!k.delivery.location &&
|
|
10521
|
+
!k.delivery.location && qa(f, u, k.delivery.min_days, k.delivery.max_days) && /* @__PURE__ */ h("div", {
|
|
10475
10522
|
...X("delivery-detail"),
|
|
10476
10523
|
style: {
|
|
10477
10524
|
fontSize: "14px",
|
|
10478
10525
|
color: $
|
|
10479
10526
|
},
|
|
10480
|
-
children:
|
|
10527
|
+
children: qa(f, u, k.delivery.min_days, k.delivery.max_days)
|
|
10481
10528
|
})
|
|
10482
10529
|
]
|
|
10483
10530
|
}),
|
|
@@ -10490,14 +10537,14 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10490
10537
|
children: [
|
|
10491
10538
|
f("total"),
|
|
10492
10539
|
": ",
|
|
10493
|
-
|
|
10540
|
+
Ba(k.total, k.currency, u)
|
|
10494
10541
|
]
|
|
10495
10542
|
}),
|
|
10496
|
-
!t && /* @__PURE__ */ h(
|
|
10543
|
+
!t && /* @__PURE__ */ h(Zo, {
|
|
10497
10544
|
reference: k.transfer_reference,
|
|
10498
10545
|
words: f
|
|
10499
10546
|
}),
|
|
10500
|
-
/* @__PURE__ */ h(
|
|
10547
|
+
/* @__PURE__ */ h(Qo, {
|
|
10501
10548
|
downloads: k.downloads,
|
|
10502
10549
|
apiUrl: c,
|
|
10503
10550
|
words: f,
|
|
@@ -10509,7 +10556,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10509
10556
|
onClick: a ? (e) => e.preventDefault() : void 0,
|
|
10510
10557
|
...X("continue-button"),
|
|
10511
10558
|
style: {
|
|
10512
|
-
...
|
|
10559
|
+
...Co,
|
|
10513
10560
|
alignSelf: "flex-start"
|
|
10514
10561
|
},
|
|
10515
10562
|
children: f("continue")
|
|
@@ -10517,7 +10564,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10517
10564
|
]
|
|
10518
10565
|
});
|
|
10519
10566
|
}
|
|
10520
|
-
let ie = r && i && !_.lines.length ?
|
|
10567
|
+
let ie = r && i && !_.lines.length ? No.slice(0, 2).map((e) => ({
|
|
10521
10568
|
...e,
|
|
10522
10569
|
product_id: e.id,
|
|
10523
10570
|
variant_id: null,
|
|
@@ -10563,7 +10610,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10563
10610
|
onClick: a ? (e) => e.preventDefault() : void 0,
|
|
10564
10611
|
...X("continue-button"),
|
|
10565
10612
|
style: {
|
|
10566
|
-
...
|
|
10613
|
+
...Co,
|
|
10567
10614
|
alignSelf: "flex-start"
|
|
10568
10615
|
},
|
|
10569
10616
|
children: f("continue")
|
|
@@ -10601,7 +10648,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10601
10648
|
...X("section"),
|
|
10602
10649
|
children: [/* @__PURE__ */ h("h3", {
|
|
10603
10650
|
...X("heading"),
|
|
10604
|
-
style:
|
|
10651
|
+
style: Ho,
|
|
10605
10652
|
children: f("contact")
|
|
10606
10653
|
}), /* @__PURE__ */ g("div", {
|
|
10607
10654
|
...X("fields"),
|
|
@@ -10609,7 +10656,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10609
10656
|
display: "grid",
|
|
10610
10657
|
gap: "12px"
|
|
10611
10658
|
},
|
|
10612
|
-
children: [/* @__PURE__ */ h(
|
|
10659
|
+
children: [/* @__PURE__ */ h(Uo, {
|
|
10613
10660
|
label: f("name"),
|
|
10614
10661
|
required: !0,
|
|
10615
10662
|
children: /* @__PURE__ */ h("input", {
|
|
@@ -10626,7 +10673,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10626
10673
|
gridTemplateColumns: "1fr 1fr",
|
|
10627
10674
|
gap: "12px"
|
|
10628
10675
|
},
|
|
10629
|
-
children: [/* @__PURE__ */ h(
|
|
10676
|
+
children: [/* @__PURE__ */ h(Uo, {
|
|
10630
10677
|
label: f("email"),
|
|
10631
10678
|
required: !0,
|
|
10632
10679
|
children: /* @__PURE__ */ h("input", {
|
|
@@ -10637,7 +10684,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10637
10684
|
onChange: L("email"),
|
|
10638
10685
|
autoComplete: "email"
|
|
10639
10686
|
})
|
|
10640
|
-
}), /* @__PURE__ */ h(
|
|
10687
|
+
}), /* @__PURE__ */ h(Uo, {
|
|
10641
10688
|
label: f("phone"),
|
|
10642
10689
|
children: /* @__PURE__ */ h("input", {
|
|
10643
10690
|
type: "tel",
|
|
@@ -10656,7 +10703,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10656
10703
|
children: [
|
|
10657
10704
|
/* @__PURE__ */ h("h3", {
|
|
10658
10705
|
...X("heading"),
|
|
10659
|
-
style:
|
|
10706
|
+
style: Ho,
|
|
10660
10707
|
children: f("delivery")
|
|
10661
10708
|
}),
|
|
10662
10709
|
/* @__PURE__ */ h("div", {
|
|
@@ -10668,17 +10715,17 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10668
10715
|
gridTemplateColumns: "1fr 1fr",
|
|
10669
10716
|
gap: "12px"
|
|
10670
10717
|
},
|
|
10671
|
-
children: [/* @__PURE__ */ h(
|
|
10718
|
+
children: [/* @__PURE__ */ h(Uo, {
|
|
10672
10719
|
label: f("postal"),
|
|
10673
10720
|
children: /* @__PURE__ */ h("input", {
|
|
10674
10721
|
...X("input"),
|
|
10675
10722
|
style: Z,
|
|
10676
10723
|
value: x.postal_code,
|
|
10677
10724
|
onChange: L("postal_code"),
|
|
10678
|
-
onBlur: () => !r && x.country && m.setCountry(x.country, x.postal_code).catch((e) => O(
|
|
10725
|
+
onBlur: () => !r && x.country && m.setCountry(x.country, x.postal_code).catch((e) => O(Ua(f, e))),
|
|
10679
10726
|
autoComplete: "postal-code"
|
|
10680
10727
|
})
|
|
10681
|
-
}), /* @__PURE__ */ h(
|
|
10728
|
+
}), /* @__PURE__ */ h(Uo, {
|
|
10682
10729
|
label: f("country"),
|
|
10683
10730
|
required: !K,
|
|
10684
10731
|
children: /* @__PURE__ */ g("select", {
|
|
@@ -10691,7 +10738,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10691
10738
|
S((e) => ({
|
|
10692
10739
|
...e,
|
|
10693
10740
|
country: t
|
|
10694
|
-
})), r || m.setCountry(t, x.postal_code).catch((e) => O(
|
|
10741
|
+
})), r || m.setCountry(t, x.postal_code).catch((e) => O(Ua(f, e)));
|
|
10695
10742
|
},
|
|
10696
10743
|
children: [/* @__PURE__ */ h("option", {
|
|
10697
10744
|
value: "",
|
|
@@ -10720,7 +10767,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10720
10767
|
gap: "8px"
|
|
10721
10768
|
},
|
|
10722
10769
|
children: ne.map((e) => {
|
|
10723
|
-
let t =
|
|
10770
|
+
let t = qa(f, u, e.min_days, e.max_days);
|
|
10724
10771
|
return /* @__PURE__ */ g("label", {
|
|
10725
10772
|
...X("delivery-option", G?.id === e.id && "delivery-option-selected"),
|
|
10726
10773
|
style: {
|
|
@@ -10729,7 +10776,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10729
10776
|
gap: "10px",
|
|
10730
10777
|
padding: "12px",
|
|
10731
10778
|
borderRadius: "8px",
|
|
10732
|
-
border: G?.id === e.id ? "1px solid var(--page-accent, #4f46e5)" :
|
|
10779
|
+
border: G?.id === e.id ? "1px solid var(--page-accent, #4f46e5)" : bo,
|
|
10733
10780
|
cursor: "pointer"
|
|
10734
10781
|
},
|
|
10735
10782
|
children: [
|
|
@@ -10792,7 +10839,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10792
10839
|
...X("section"),
|
|
10793
10840
|
children: [/* @__PURE__ */ h("h3", {
|
|
10794
10841
|
...X("heading"),
|
|
10795
|
-
style:
|
|
10842
|
+
style: Ho,
|
|
10796
10843
|
children: f("address")
|
|
10797
10844
|
}), /* @__PURE__ */ g("div", {
|
|
10798
10845
|
...X("fields"),
|
|
@@ -10801,7 +10848,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10801
10848
|
gap: "12px"
|
|
10802
10849
|
},
|
|
10803
10850
|
children: [
|
|
10804
|
-
/* @__PURE__ */ h(
|
|
10851
|
+
/* @__PURE__ */ h(Uo, {
|
|
10805
10852
|
label: f("line1"),
|
|
10806
10853
|
required: !0,
|
|
10807
10854
|
children: /* @__PURE__ */ h("input", {
|
|
@@ -10812,7 +10859,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10812
10859
|
autoComplete: "address-line1"
|
|
10813
10860
|
})
|
|
10814
10861
|
}),
|
|
10815
|
-
/* @__PURE__ */ h(
|
|
10862
|
+
/* @__PURE__ */ h(Uo, {
|
|
10816
10863
|
label: f("line2"),
|
|
10817
10864
|
children: /* @__PURE__ */ h("input", {
|
|
10818
10865
|
...X("input"),
|
|
@@ -10829,7 +10876,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10829
10876
|
gridTemplateColumns: "1fr 1fr",
|
|
10830
10877
|
gap: "12px"
|
|
10831
10878
|
},
|
|
10832
|
-
children: [/* @__PURE__ */ h(
|
|
10879
|
+
children: [/* @__PURE__ */ h(Uo, {
|
|
10833
10880
|
label: f("city"),
|
|
10834
10881
|
required: !0,
|
|
10835
10882
|
children: /* @__PURE__ */ h("input", {
|
|
@@ -10839,7 +10886,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10839
10886
|
onChange: L("city"),
|
|
10840
10887
|
autoComplete: "address-level2"
|
|
10841
10888
|
})
|
|
10842
|
-
}), /* @__PURE__ */ h(
|
|
10889
|
+
}), /* @__PURE__ */ h(Uo, {
|
|
10843
10890
|
label: f("region"),
|
|
10844
10891
|
children: /* @__PURE__ */ h("input", {
|
|
10845
10892
|
...X("input"),
|
|
@@ -10850,7 +10897,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10850
10897
|
})
|
|
10851
10898
|
})]
|
|
10852
10899
|
}),
|
|
10853
|
-
/* @__PURE__ */ h(
|
|
10900
|
+
/* @__PURE__ */ h(Uo, {
|
|
10854
10901
|
label: f("note"),
|
|
10855
10902
|
children: /* @__PURE__ */ h("textarea", {
|
|
10856
10903
|
rows: 2,
|
|
@@ -10905,7 +10952,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10905
10952
|
display: "grid",
|
|
10906
10953
|
gap: "12px"
|
|
10907
10954
|
},
|
|
10908
|
-
children: [H && !K && /* @__PURE__ */ h(
|
|
10955
|
+
children: [H && !K && /* @__PURE__ */ h(Uo, {
|
|
10909
10956
|
label: f("giftRecipient"),
|
|
10910
10957
|
children: /* @__PURE__ */ h("input", {
|
|
10911
10958
|
...X("input"),
|
|
@@ -10915,7 +10962,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10915
10962
|
maxLength: 200,
|
|
10916
10963
|
autoComplete: "off"
|
|
10917
10964
|
})
|
|
10918
|
-
}), /* @__PURE__ */ h(
|
|
10965
|
+
}), /* @__PURE__ */ h(Uo, {
|
|
10919
10966
|
label: f("giftMessage"),
|
|
10920
10967
|
children: /* @__PURE__ */ h("textarea", {
|
|
10921
10968
|
rows: 3,
|
|
@@ -10936,7 +10983,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10936
10983
|
children: [
|
|
10937
10984
|
/* @__PURE__ */ h("h3", {
|
|
10938
10985
|
...X("heading"),
|
|
10939
|
-
style:
|
|
10986
|
+
style: Ho,
|
|
10940
10987
|
children: f("payment")
|
|
10941
10988
|
}),
|
|
10942
10989
|
!oe.length && !r && /* @__PURE__ */ h("p", {
|
|
@@ -10961,7 +11008,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10961
11008
|
gap: "10px",
|
|
10962
11009
|
padding: "12px",
|
|
10963
11010
|
borderRadius: "8px",
|
|
10964
|
-
border:
|
|
11011
|
+
border: bo,
|
|
10965
11012
|
cursor: "pointer"
|
|
10966
11013
|
},
|
|
10967
11014
|
children: [/* @__PURE__ */ h("input", {
|
|
@@ -10988,13 +11035,13 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
10988
11035
|
gap: "14px",
|
|
10989
11036
|
padding: "20px",
|
|
10990
11037
|
borderRadius: "12px",
|
|
10991
|
-
background:
|
|
11038
|
+
background: xo
|
|
10992
11039
|
},
|
|
10993
11040
|
children: [
|
|
10994
11041
|
/* @__PURE__ */ h("h3", {
|
|
10995
11042
|
...X("summary-title"),
|
|
10996
11043
|
style: {
|
|
10997
|
-
...
|
|
11044
|
+
...Ho,
|
|
10998
11045
|
margin: 0
|
|
10999
11046
|
},
|
|
11000
11047
|
children: f("cart")
|
|
@@ -11057,13 +11104,13 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
11057
11104
|
gap: "8px",
|
|
11058
11105
|
marginTop: "4px"
|
|
11059
11106
|
},
|
|
11060
|
-
children: [/* @__PURE__ */ h(
|
|
11107
|
+
children: [/* @__PURE__ */ h(Do, {
|
|
11061
11108
|
value: e.quantity,
|
|
11062
11109
|
label: f("quantity"),
|
|
11063
|
-
onCommit: (t) => !r && m.setLine(e.product_id, e.variant_id, t).catch((e) => O(
|
|
11110
|
+
onCommit: (t) => !r && m.setLine(e.product_id, e.variant_id, t).catch((e) => O(Ua(f, e)))
|
|
11064
11111
|
}), /* @__PURE__ */ h("button", {
|
|
11065
11112
|
type: "button",
|
|
11066
|
-
onClick: () => !r && m.setLine(e.product_id, e.variant_id, 0).catch((e) => O(
|
|
11113
|
+
onClick: () => !r && m.setLine(e.product_id, e.variant_id, 0).catch((e) => O(Ua(f, e))),
|
|
11067
11114
|
...X("remove-button"),
|
|
11068
11115
|
style: {
|
|
11069
11116
|
background: "none",
|
|
@@ -11113,7 +11160,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
11113
11160
|
style: {
|
|
11114
11161
|
padding: "4px 10px",
|
|
11115
11162
|
borderRadius: "999px",
|
|
11116
|
-
border:
|
|
11163
|
+
border: bo,
|
|
11117
11164
|
fontWeight: 600,
|
|
11118
11165
|
letterSpacing: "0.04em"
|
|
11119
11166
|
},
|
|
@@ -11161,7 +11208,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
11161
11208
|
onClick: () => z(j.trim()),
|
|
11162
11209
|
...X("coupon-button"),
|
|
11163
11210
|
style: {
|
|
11164
|
-
...
|
|
11211
|
+
...Co,
|
|
11165
11212
|
padding: "8px 14px"
|
|
11166
11213
|
},
|
|
11167
11214
|
children: f("apply")
|
|
@@ -11178,7 +11225,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
11178
11225
|
/* @__PURE__ */ g("div", {
|
|
11179
11226
|
...X("totals"),
|
|
11180
11227
|
style: {
|
|
11181
|
-
borderTop:
|
|
11228
|
+
borderTop: bo,
|
|
11182
11229
|
paddingTop: "12px",
|
|
11183
11230
|
display: "grid",
|
|
11184
11231
|
gap: "6px",
|
|
@@ -11293,13 +11340,13 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
11293
11340
|
...X("submit-button"),
|
|
11294
11341
|
disabled: T || !C || _.shipping_available === !1,
|
|
11295
11342
|
style: {
|
|
11296
|
-
...
|
|
11343
|
+
...So,
|
|
11297
11344
|
width: "100%",
|
|
11298
11345
|
padding: "12px"
|
|
11299
11346
|
},
|
|
11300
11347
|
children: f(T ? "placing" : "placeOrder")
|
|
11301
11348
|
}),
|
|
11302
|
-
/* @__PURE__ */ h(
|
|
11349
|
+
/* @__PURE__ */ h(Jo, {
|
|
11303
11350
|
apiUrl: c,
|
|
11304
11351
|
tenant: o,
|
|
11305
11352
|
words: f,
|
|
@@ -11311,7 +11358,7 @@ function Uo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
11311
11358
|
})]
|
|
11312
11359
|
});
|
|
11313
11360
|
}
|
|
11314
|
-
var
|
|
11361
|
+
var qo = [
|
|
11315
11362
|
"refund",
|
|
11316
11363
|
"privacy",
|
|
11317
11364
|
"terms",
|
|
@@ -11322,12 +11369,12 @@ var Wo = [
|
|
|
11322
11369
|
fields: {},
|
|
11323
11370
|
updated_at: null
|
|
11324
11371
|
}));
|
|
11325
|
-
function
|
|
11326
|
-
let [o, c] = d(i ?
|
|
11372
|
+
function Jo({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a }) {
|
|
11373
|
+
let [o, c] = d(i ? qo : []), [l, u] = d(null);
|
|
11327
11374
|
if (s(() => {
|
|
11328
11375
|
if (i) return;
|
|
11329
11376
|
let n = !0;
|
|
11330
|
-
return
|
|
11377
|
+
return Ga(e, t).then((e) => n && c(e)), () => {
|
|
11331
11378
|
n = !1;
|
|
11332
11379
|
};
|
|
11333
11380
|
}, [
|
|
@@ -11370,12 +11417,12 @@ function Go({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a })
|
|
|
11370
11417
|
display: "flex",
|
|
11371
11418
|
flexWrap: "wrap",
|
|
11372
11419
|
gap: "6px 14px",
|
|
11373
|
-
borderTop:
|
|
11420
|
+
borderTop: bo,
|
|
11374
11421
|
paddingTop: "10px"
|
|
11375
11422
|
},
|
|
11376
11423
|
children: o.map(m)
|
|
11377
11424
|
}),
|
|
11378
|
-
l && /* @__PURE__ */ h(
|
|
11425
|
+
l && /* @__PURE__ */ h(Yo, {
|
|
11379
11426
|
policy: l,
|
|
11380
11427
|
words: n,
|
|
11381
11428
|
locale: r,
|
|
@@ -11384,7 +11431,7 @@ function Go({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a })
|
|
|
11384
11431
|
]
|
|
11385
11432
|
});
|
|
11386
11433
|
}
|
|
11387
|
-
function
|
|
11434
|
+
function Yo({ policy: e, words: t, locale: n, onClose: r }) {
|
|
11388
11435
|
s(() => {
|
|
11389
11436
|
let e = (e) => {
|
|
11390
11437
|
e.key === "Escape" && r();
|
|
@@ -11422,7 +11469,7 @@ function Ko({ policy: e, words: t, locale: n, onClose: r }) {
|
|
|
11422
11469
|
style: {
|
|
11423
11470
|
background: "var(--page-bg, #fff)",
|
|
11424
11471
|
color: "var(--page-text, #111827)",
|
|
11425
|
-
border:
|
|
11472
|
+
border: bo,
|
|
11426
11473
|
borderRadius: "12px",
|
|
11427
11474
|
width: "min(720px, 100%)",
|
|
11428
11475
|
maxHeight: "85vh",
|
|
@@ -11437,7 +11484,7 @@ function Ko({ policy: e, words: t, locale: n, onClose: r }) {
|
|
|
11437
11484
|
alignItems: "center",
|
|
11438
11485
|
gap: "12px",
|
|
11439
11486
|
padding: "16px 20px",
|
|
11440
|
-
borderBottom:
|
|
11487
|
+
borderBottom: bo
|
|
11441
11488
|
},
|
|
11442
11489
|
children: [/* @__PURE__ */ h("strong", {
|
|
11443
11490
|
...X("modal-title"),
|
|
@@ -11452,7 +11499,7 @@ function Ko({ policy: e, words: t, locale: n, onClose: r }) {
|
|
|
11452
11499
|
"aria-label": t("close"),
|
|
11453
11500
|
...X("modal-close"),
|
|
11454
11501
|
style: {
|
|
11455
|
-
...
|
|
11502
|
+
...Co,
|
|
11456
11503
|
padding: "4px 10px"
|
|
11457
11504
|
},
|
|
11458
11505
|
children: "×"
|
|
@@ -11506,12 +11553,12 @@ function Ko({ policy: e, words: t, locale: n, onClose: r }) {
|
|
|
11506
11553
|
})
|
|
11507
11554
|
});
|
|
11508
11555
|
}
|
|
11509
|
-
var
|
|
11556
|
+
var Xo = {
|
|
11510
11557
|
year: "numeric",
|
|
11511
11558
|
month: "short",
|
|
11512
11559
|
day: "numeric"
|
|
11513
11560
|
};
|
|
11514
|
-
function
|
|
11561
|
+
function Zo({ reference: e, words: t }) {
|
|
11515
11562
|
let [n, r] = d(!1);
|
|
11516
11563
|
if (!e) return null;
|
|
11517
11564
|
let i = () => {
|
|
@@ -11559,7 +11606,7 @@ function Jo({ reference: e, words: t }) {
|
|
|
11559
11606
|
onClick: i,
|
|
11560
11607
|
...X("copy-button"),
|
|
11561
11608
|
style: {
|
|
11562
|
-
...
|
|
11609
|
+
...Co,
|
|
11563
11610
|
padding: "6px 12px"
|
|
11564
11611
|
},
|
|
11565
11612
|
children: t(n ? "copied" : "copy")
|
|
@@ -11576,7 +11623,7 @@ function Jo({ reference: e, words: t }) {
|
|
|
11576
11623
|
]
|
|
11577
11624
|
});
|
|
11578
11625
|
}
|
|
11579
|
-
function
|
|
11626
|
+
function Qo({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
|
|
11580
11627
|
let a = Array.isArray(e) ? e.filter((e) => e && e.token && !e.revoked_at) : [];
|
|
11581
11628
|
if (!a.length) return null;
|
|
11582
11629
|
let o = (e) => {
|
|
@@ -11606,7 +11653,7 @@ function Yo({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
|
|
|
11606
11653
|
alignItems: "center",
|
|
11607
11654
|
gap: "12px",
|
|
11608
11655
|
padding: "10px 12px",
|
|
11609
|
-
border:
|
|
11656
|
+
border: bo,
|
|
11610
11657
|
borderRadius: "8px"
|
|
11611
11658
|
},
|
|
11612
11659
|
children: [/* @__PURE__ */ g("div", {
|
|
@@ -11636,7 +11683,7 @@ function Yo({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
|
|
|
11636
11683
|
onClick: i ? (e) => e.preventDefault() : void 0,
|
|
11637
11684
|
...X("download-button"),
|
|
11638
11685
|
style: {
|
|
11639
|
-
...
|
|
11686
|
+
...So,
|
|
11640
11687
|
padding: "6px 14px",
|
|
11641
11688
|
textDecoration: "none",
|
|
11642
11689
|
fontSize: "14px"
|
|
@@ -11654,7 +11701,7 @@ function Yo({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
|
|
|
11654
11701
|
})]
|
|
11655
11702
|
});
|
|
11656
11703
|
}
|
|
11657
|
-
function
|
|
11704
|
+
function $o({ tracking: e, words: t, noNavigate: n }) {
|
|
11658
11705
|
let r = typeof e?.carrier == "string" ? e.carrier : "", i = typeof e?.number == "string" ? e.number : "", a = typeof e?.url == "string" && /^https?:\/\//i.test(e.url) ? e.url : "";
|
|
11659
11706
|
return !r && !i && !a ? null : /* @__PURE__ */ g("div", {
|
|
11660
11707
|
...X("tracking"),
|
|
@@ -11689,8 +11736,8 @@ function Xo({ tracking: e, words: t, noNavigate: n }) {
|
|
|
11689
11736
|
]
|
|
11690
11737
|
});
|
|
11691
11738
|
}
|
|
11692
|
-
function
|
|
11693
|
-
let { tenant: c, apiUrl: l, locale: u, words: f, orderId: p } =
|
|
11739
|
+
function es({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, inert: i = !1, sample: a = !1, noNavigate: o = !1 }) {
|
|
11740
|
+
let { tenant: c, apiUrl: l, locale: u, words: f, orderId: p } = wo(), [m, _] = d(null), [v, y] = d(!1), [b, x] = d("");
|
|
11694
11741
|
s(() => {
|
|
11695
11742
|
if (i) return;
|
|
11696
11743
|
let e = !0;
|
|
@@ -11725,7 +11772,7 @@ function Zo({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
|
|
|
11725
11772
|
items: []
|
|
11726
11773
|
}] : m ?? [], C = (e) => {
|
|
11727
11774
|
try {
|
|
11728
|
-
return new Intl.DateTimeFormat(u || void 0,
|
|
11775
|
+
return new Intl.DateTimeFormat(u || void 0, Xo).format(new Date(e));
|
|
11729
11776
|
} catch {
|
|
11730
11777
|
return String(e).slice(0, 10);
|
|
11731
11778
|
}
|
|
@@ -11768,7 +11815,7 @@ function Zo({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
|
|
|
11768
11815
|
S.map((e) => /* @__PURE__ */ g("div", {
|
|
11769
11816
|
...X("order", b === e.id && "order-open"),
|
|
11770
11817
|
style: {
|
|
11771
|
-
border:
|
|
11818
|
+
border: bo,
|
|
11772
11819
|
borderRadius: "10px",
|
|
11773
11820
|
overflow: "hidden"
|
|
11774
11821
|
},
|
|
@@ -11809,13 +11856,13 @@ function Zo({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
|
|
|
11809
11856
|
fontSize: "13px",
|
|
11810
11857
|
padding: "2px 10px",
|
|
11811
11858
|
borderRadius: "999px",
|
|
11812
|
-
background:
|
|
11859
|
+
background: xo
|
|
11813
11860
|
},
|
|
11814
11861
|
children: [f(`st_${e.status}`), e.payment_status === "paid" ? "" : ` · ${f(`pay_${e.payment_status}`)}`]
|
|
11815
11862
|
}),
|
|
11816
11863
|
/* @__PURE__ */ h("strong", {
|
|
11817
11864
|
...X("order-total"),
|
|
11818
|
-
children:
|
|
11865
|
+
children: Ba(e.total, e.currency, u)
|
|
11819
11866
|
})
|
|
11820
11867
|
]
|
|
11821
11868
|
}), b === e.id && e.items?.length > 0 && /* @__PURE__ */ g("div", {
|
|
@@ -11845,19 +11892,19 @@ function Zo({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
|
|
|
11845
11892
|
})
|
|
11846
11893
|
] }), /* @__PURE__ */ h("span", {
|
|
11847
11894
|
...X("order-item-price"),
|
|
11848
|
-
children:
|
|
11895
|
+
children: Ba(t.total, e.currency, u)
|
|
11849
11896
|
})]
|
|
11850
11897
|
}, t.id)),
|
|
11851
|
-
e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ h(
|
|
11898
|
+
e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ h(Zo, {
|
|
11852
11899
|
reference: e.transfer_reference,
|
|
11853
11900
|
words: f
|
|
11854
11901
|
}),
|
|
11855
|
-
/* @__PURE__ */ h(
|
|
11902
|
+
/* @__PURE__ */ h($o, {
|
|
11856
11903
|
tracking: e.tracking,
|
|
11857
11904
|
words: f,
|
|
11858
11905
|
noNavigate: o
|
|
11859
11906
|
}),
|
|
11860
|
-
/* @__PURE__ */ h(
|
|
11907
|
+
/* @__PURE__ */ h(Qo, {
|
|
11861
11908
|
downloads: e.downloads,
|
|
11862
11909
|
apiUrl: l,
|
|
11863
11910
|
words: f,
|
|
@@ -11872,21 +11919,21 @@ function Zo({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
|
|
|
11872
11919
|
}
|
|
11873
11920
|
//#endregion
|
|
11874
11921
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
11875
|
-
function
|
|
11922
|
+
function ts(e) {
|
|
11876
11923
|
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());
|
|
11877
11924
|
return [...new Set(n.map((e) => e.trim()))];
|
|
11878
11925
|
}
|
|
11879
|
-
var
|
|
11880
|
-
function
|
|
11926
|
+
var ns = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
11927
|
+
function rs(e, t) {
|
|
11881
11928
|
let n = String(e ?? "").toUpperCase();
|
|
11882
11929
|
if (t === "code") return n;
|
|
11883
11930
|
let r = "";
|
|
11884
11931
|
try {
|
|
11885
|
-
r =
|
|
11932
|
+
r = ns(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
11886
11933
|
} catch {}
|
|
11887
11934
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
11888
11935
|
}
|
|
11889
|
-
function
|
|
11936
|
+
function is(e, t) {
|
|
11890
11937
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
11891
11938
|
if (typeof window > "u") return n || "?";
|
|
11892
11939
|
try {
|
|
@@ -11896,8 +11943,8 @@ function ts(e, t) {
|
|
|
11896
11943
|
return n || "/";
|
|
11897
11944
|
}
|
|
11898
11945
|
}
|
|
11899
|
-
function
|
|
11900
|
-
let l = o(Y), u =
|
|
11946
|
+
function as({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: s, inert: c }) {
|
|
11947
|
+
let l = o(Y), u = ts(l?.settings), d = u[0] ?? "", f = u.includes(l?.locale) ? l.locale : d, p = {
|
|
11901
11948
|
display: "inline-flex",
|
|
11902
11949
|
alignItems: "center",
|
|
11903
11950
|
gap: 8,
|
|
@@ -11935,7 +11982,7 @@ function ns({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
11935
11982
|
children: n ?? "·"
|
|
11936
11983
|
}), /* @__PURE__ */ h("a", {
|
|
11937
11984
|
...X("link", e === f && "link-current"),
|
|
11938
|
-
href:
|
|
11985
|
+
href: is(e, e === d),
|
|
11939
11986
|
hrefLang: e,
|
|
11940
11987
|
"aria-current": e === f ? "true" : void 0,
|
|
11941
11988
|
onClick: c ? (e) => e.preventDefault() : void 0,
|
|
@@ -11945,7 +11992,7 @@ function ns({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
11945
11992
|
textDecoration: "none",
|
|
11946
11993
|
cursor: c ? "default" : "pointer"
|
|
11947
11994
|
},
|
|
11948
|
-
children:
|
|
11995
|
+
children: rs(e, t)
|
|
11949
11996
|
})]
|
|
11950
11997
|
}, e))]
|
|
11951
11998
|
}) : /* @__PURE__ */ g("div", {
|
|
@@ -11957,7 +12004,7 @@ function ns({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
11957
12004
|
value: f,
|
|
11958
12005
|
onChange: c ? void 0 : (e) => {
|
|
11959
12006
|
let t = e.target.value;
|
|
11960
|
-
window.location.assign(
|
|
12007
|
+
window.location.assign(is(t, t === d));
|
|
11961
12008
|
},
|
|
11962
12009
|
onKeyDown: c ? (e) => e.preventDefault() : void 0,
|
|
11963
12010
|
style: {
|
|
@@ -11973,54 +12020,54 @@ function ns({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
11973
12020
|
...X("option", e === f && "option-current"),
|
|
11974
12021
|
key: e,
|
|
11975
12022
|
value: e
|
|
11976
|
-
},
|
|
12023
|
+
}, rs(e, t)))
|
|
11977
12024
|
})]
|
|
11978
12025
|
});
|
|
11979
12026
|
}
|
|
11980
12027
|
//#endregion
|
|
11981
12028
|
//#region ../ui/src/components/builder/apps/index.js
|
|
11982
|
-
var
|
|
11983
|
-
|
|
11984
|
-
|
|
11985
|
-
|
|
11986
|
-
|
|
11987
|
-
|
|
11988
|
-
],
|
|
11989
|
-
SiteLoginForm:
|
|
11990
|
-
SiteAccountMenu:
|
|
11991
|
-
SiteLanguagePicker:
|
|
11992
|
-
CookieConsent:
|
|
11993
|
-
SiteSearch:
|
|
11994
|
-
ShopProductGrid:
|
|
11995
|
-
ShopProduct:
|
|
11996
|
-
ShopCartButton:
|
|
11997
|
-
ShopCheckout:
|
|
11998
|
-
ShopOrderHistory:
|
|
11999
|
-
ShopCurrencyPicker:
|
|
12000
|
-
ShopFavorites:
|
|
12029
|
+
var os = [
|
|
12030
|
+
na,
|
|
12031
|
+
xa,
|
|
12032
|
+
ma,
|
|
12033
|
+
Sa,
|
|
12034
|
+
Oa
|
|
12035
|
+
], ss = {
|
|
12036
|
+
SiteLoginForm: fa,
|
|
12037
|
+
SiteAccountMenu: pa,
|
|
12038
|
+
SiteLanguagePicker: as,
|
|
12039
|
+
CookieConsent: ba,
|
|
12040
|
+
SiteSearch: Da,
|
|
12041
|
+
ShopProductGrid: Po,
|
|
12042
|
+
ShopProduct: Fo,
|
|
12043
|
+
ShopCartButton: Ro,
|
|
12044
|
+
ShopCheckout: Ko,
|
|
12045
|
+
ShopOrderHistory: es,
|
|
12046
|
+
ShopCurrencyPicker: Bo,
|
|
12047
|
+
ShopFavorites: Io
|
|
12001
12048
|
};
|
|
12002
|
-
new Set(
|
|
12049
|
+
new Set(os.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
12003
12050
|
//#endregion
|
|
12004
12051
|
//#region ../ui/src/components/builder/three/runtime.js
|
|
12005
|
-
var
|
|
12052
|
+
var cs = "0.185.1", ls = "4.2.0", us = "https://cdn.jsdelivr.net/npm", ds = `${us}/three@${cs}/+esm`, fs = `${us}/@google/model-viewer@${ls}/dist/model-viewer.min.js`, ps = (e) => import(
|
|
12006
12053
|
/* @vite-ignore */
|
|
12007
12054
|
/* webpackIgnore: true */
|
|
12008
12055
|
e
|
|
12009
|
-
),
|
|
12010
|
-
function
|
|
12011
|
-
if (
|
|
12056
|
+
), ms = /* @__PURE__ */ new Map();
|
|
12057
|
+
function hs(e) {
|
|
12058
|
+
if (ms.has(e)) return ms.get(e);
|
|
12012
12059
|
if (typeof window > "u") return new Promise(() => {});
|
|
12013
|
-
let t =
|
|
12014
|
-
throw
|
|
12060
|
+
let t = ps(e).catch((t) => {
|
|
12061
|
+
throw ms.delete(e), t;
|
|
12015
12062
|
});
|
|
12016
|
-
return
|
|
12063
|
+
return ms.set(e, t), t;
|
|
12017
12064
|
}
|
|
12018
|
-
var
|
|
12019
|
-
function
|
|
12020
|
-
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : fs
|
|
12065
|
+
var gs = () => hs(ds), _s = (e) => hs(`${us}/three@${cs}/examples/jsm/${e}/+esm`);
|
|
12066
|
+
function vs() {
|
|
12067
|
+
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : hs(fs);
|
|
12021
12068
|
}
|
|
12022
|
-
var
|
|
12023
|
-
function
|
|
12069
|
+
var ys = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, bs = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
|
|
12070
|
+
function xs(e, t) {
|
|
12024
12071
|
let n = 0, r = 0, i = 0, a = !0, o = (e) => {
|
|
12025
12072
|
n = requestAnimationFrame(o), i ||= e;
|
|
12026
12073
|
let a = r ? (e - r) / 1e3 : 0;
|
|
@@ -12039,7 +12086,7 @@ function vs(e, t) {
|
|
|
12039
12086
|
s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
|
|
12040
12087
|
};
|
|
12041
12088
|
}
|
|
12042
|
-
function
|
|
12089
|
+
function Ss(e, t, n = {}) {
|
|
12043
12090
|
let r = {
|
|
12044
12091
|
radius: n.distance ?? 4,
|
|
12045
12092
|
polar: n.polar ?? Math.PI / 2.4,
|
|
@@ -12088,13 +12135,13 @@ function ys(e, t, n = {}) {
|
|
|
12088
12135
|
}
|
|
12089
12136
|
//#endregion
|
|
12090
12137
|
//#region ../ui/src/components/builder/three/views.jsx
|
|
12091
|
-
var
|
|
12092
|
-
function
|
|
12138
|
+
var Cs = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, ws = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, Ts = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, Es = (e) => typeof e == "string" && !!e.trim();
|
|
12139
|
+
function Ds({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
12093
12140
|
return /* @__PURE__ */ g("div", {
|
|
12094
12141
|
ref: r,
|
|
12095
12142
|
style: {
|
|
12096
12143
|
...U(i),
|
|
12097
|
-
minHeight:
|
|
12144
|
+
minHeight: Cs(n, 320),
|
|
12098
12145
|
display: "flex",
|
|
12099
12146
|
flexDirection: "column",
|
|
12100
12147
|
alignItems: "center",
|
|
@@ -12122,24 +12169,24 @@ function ws({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
12122
12169
|
}) : null]
|
|
12123
12170
|
});
|
|
12124
12171
|
}
|
|
12125
|
-
function
|
|
12172
|
+
function Os({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotateDelay: o, cameraControls: c, ar: l, exposure: u, shadow: f, fieldOfView: p, environment: m, style: g, nodeRef: _, inert: v }) {
|
|
12126
12173
|
let [y, b] = d(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = d(!1);
|
|
12127
12174
|
s(() => {
|
|
12128
12175
|
if (y || !e) return;
|
|
12129
12176
|
let t = !0;
|
|
12130
|
-
return
|
|
12177
|
+
return vs().then(() => t && b(!0), () => t && S(!0)), () => {
|
|
12131
12178
|
t = !1;
|
|
12132
12179
|
};
|
|
12133
12180
|
}, [y, e]);
|
|
12134
12181
|
let C = {
|
|
12135
12182
|
display: "block",
|
|
12136
12183
|
width: "100%",
|
|
12137
|
-
minHeight:
|
|
12138
|
-
height:
|
|
12184
|
+
minHeight: Cs(r, 360),
|
|
12185
|
+
height: Cs(r, 360),
|
|
12139
12186
|
backgroundColor: i || "transparent",
|
|
12140
12187
|
...U(g)
|
|
12141
12188
|
};
|
|
12142
|
-
if (!e) return v ? /* @__PURE__ */ h(
|
|
12189
|
+
if (!e) return v ? /* @__PURE__ */ h(Ds, {
|
|
12143
12190
|
nodeRef: _,
|
|
12144
12191
|
style: g,
|
|
12145
12192
|
height: r,
|
|
@@ -12174,13 +12221,13 @@ function Ts({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotate
|
|
|
12174
12221
|
poster: t || void 0,
|
|
12175
12222
|
style: C,
|
|
12176
12223
|
"camera-controls": w(!v && c !== !1),
|
|
12177
|
-
"auto-rotate": w(T && !
|
|
12178
|
-
"auto-rotate-delay": T ? String(
|
|
12224
|
+
"auto-rotate": w(T && !ys()),
|
|
12225
|
+
"auto-rotate-delay": T ? String(Cs(o, 0)) : void 0,
|
|
12179
12226
|
"rotation-per-second": "18deg",
|
|
12180
12227
|
ar: w(!v && l === !0),
|
|
12181
12228
|
"ar-modes": "webxr scene-viewer quick-look",
|
|
12182
|
-
"shadow-intensity": String(
|
|
12183
|
-
exposure: String(
|
|
12229
|
+
"shadow-intensity": String(ws(f, 100)),
|
|
12230
|
+
exposure: String(ws(u, 100)),
|
|
12184
12231
|
"field-of-view": p ? `${Number(p)}deg` : void 0,
|
|
12185
12232
|
"environment-image": m && m !== "neutral" ? m : "neutral",
|
|
12186
12233
|
"interaction-prompt": v ? "none" : void 0,
|
|
@@ -12198,7 +12245,7 @@ function Ts({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotate
|
|
|
12198
12245
|
}) : null
|
|
12199
12246
|
});
|
|
12200
12247
|
}
|
|
12201
|
-
var
|
|
12248
|
+
var ks = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), As = [
|
|
12202
12249
|
"precision highp float;",
|
|
12203
12250
|
"uniform vec2 u_res;",
|
|
12204
12251
|
"uniform float u_time;",
|
|
@@ -12221,7 +12268,7 @@ var Es = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
12221
12268
|
" return v;",
|
|
12222
12269
|
"}",
|
|
12223
12270
|
""
|
|
12224
|
-
].join("\n"),
|
|
12271
|
+
].join("\n"), js = {
|
|
12225
12272
|
gradient: [
|
|
12226
12273
|
"void main(){",
|
|
12227
12274
|
" vec2 uv = gl_FragCoord.xy / u_res;",
|
|
@@ -12273,7 +12320,7 @@ var Es = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
12273
12320
|
"}"
|
|
12274
12321
|
].join("\n")
|
|
12275
12322
|
};
|
|
12276
|
-
function
|
|
12323
|
+
function Ms(e, t) {
|
|
12277
12324
|
let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
|
|
12278
12325
|
if (!n) return t;
|
|
12279
12326
|
let r = parseInt(n[1], 16);
|
|
@@ -12283,7 +12330,7 @@ function ks(e, t) {
|
|
|
12283
12330
|
(r & 255) / 255
|
|
12284
12331
|
];
|
|
12285
12332
|
}
|
|
12286
|
-
function
|
|
12333
|
+
function Ns(e, t, n) {
|
|
12287
12334
|
let r = e.createShader(t);
|
|
12288
12335
|
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
12289
12336
|
let t = e.getShaderInfoLog(r);
|
|
@@ -12291,13 +12338,13 @@ function As(e, t, n) {
|
|
|
12291
12338
|
}
|
|
12292
12339
|
return r;
|
|
12293
12340
|
}
|
|
12294
|
-
function
|
|
12341
|
+
function Ps({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, scale: o, height: c, interactive: l, style: f, nodeRef: p, inert: m }) {
|
|
12295
12342
|
let _ = u(null), v = u(null), y = u(null), [b, x] = d("");
|
|
12296
12343
|
s(() => () => {
|
|
12297
12344
|
let e = y.current;
|
|
12298
12345
|
y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
|
|
12299
12346
|
}, []);
|
|
12300
|
-
let S = typeof t == "string" && t.trim() ? t :
|
|
12347
|
+
let S = typeof t == "string" && t.trim() ? t : js[e] ?? js.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = ws(a, 100), D = Math.max(.05, ws(o, 100));
|
|
12301
12348
|
return s(() => {
|
|
12302
12349
|
let e = _.current, t = v.current;
|
|
12303
12350
|
if (!e || !t) return;
|
|
@@ -12312,7 +12359,7 @@ function js({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
|
|
|
12312
12359
|
}
|
|
12313
12360
|
let r = null;
|
|
12314
12361
|
try {
|
|
12315
|
-
let e =
|
|
12362
|
+
let e = Ns(n, n.VERTEX_SHADER, ks), t = Ns(n, n.FRAGMENT_SHADER, As + S);
|
|
12316
12363
|
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");
|
|
12317
12364
|
x("");
|
|
12318
12365
|
} catch (e) {
|
|
@@ -12348,28 +12395,28 @@ function js({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
|
|
|
12348
12395
|
};
|
|
12349
12396
|
l !== !1 && t.addEventListener("pointermove", u);
|
|
12350
12397
|
let d = () => {
|
|
12351
|
-
let r =
|
|
12398
|
+
let r = bs(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
|
|
12352
12399
|
(e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
|
|
12353
12400
|
}, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
|
|
12354
12401
|
f?.observe(t), d();
|
|
12355
|
-
let p =
|
|
12356
|
-
a:
|
|
12402
|
+
let p = ys(), m = {
|
|
12403
|
+
a: Ms(C, [
|
|
12357
12404
|
.35,
|
|
12358
12405
|
.4,
|
|
12359
12406
|
.95
|
|
12360
12407
|
]),
|
|
12361
|
-
b:
|
|
12408
|
+
b: Ms(w, [
|
|
12362
12409
|
.05,
|
|
12363
12410
|
.06,
|
|
12364
12411
|
.16
|
|
12365
12412
|
]),
|
|
12366
|
-
c:
|
|
12413
|
+
c: Ms(T, [
|
|
12367
12414
|
.95,
|
|
12368
12415
|
.35,
|
|
12369
12416
|
.6
|
|
12370
12417
|
])
|
|
12371
12418
|
}, h = {};
|
|
12372
|
-
return h.stop =
|
|
12419
|
+
return h.stop = xs(t, (t, r) => {
|
|
12373
12420
|
d(), n.uniform2f(s.res, e.width, e.height), n.uniform1f(s.time, (p ? 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), p && h.stop?.();
|
|
12374
12421
|
}), () => {
|
|
12375
12422
|
h.stop?.(), f?.disconnect(), t.removeEventListener("pointermove", u), n.deleteProgram(r), n.deleteBuffer(i);
|
|
@@ -12388,7 +12435,7 @@ function js({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
|
|
|
12388
12435
|
},
|
|
12389
12436
|
style: {
|
|
12390
12437
|
position: "relative",
|
|
12391
|
-
minHeight:
|
|
12438
|
+
minHeight: Cs(c, 320),
|
|
12392
12439
|
overflow: "hidden",
|
|
12393
12440
|
...U(f)
|
|
12394
12441
|
},
|
|
@@ -12420,7 +12467,7 @@ function js({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
|
|
|
12420
12467
|
}) : null]
|
|
12421
12468
|
});
|
|
12422
12469
|
}
|
|
12423
|
-
function
|
|
12470
|
+
function Fs(e, t) {
|
|
12424
12471
|
let n = new e.Scene(), r = new e.BoxGeometry();
|
|
12425
12472
|
r.deleteAttribute("uv");
|
|
12426
12473
|
let i = new e.Mesh(r, new e.MeshBasicMaterial({
|
|
@@ -12436,23 +12483,23 @@ function Ms(e, t) {
|
|
|
12436
12483
|
let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
|
|
12437
12484
|
return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
|
|
12438
12485
|
}
|
|
12439
|
-
var
|
|
12440
|
-
function
|
|
12441
|
-
if (
|
|
12442
|
-
let t =
|
|
12486
|
+
var Is = /* @__PURE__ */ new Map();
|
|
12487
|
+
function Ls(e) {
|
|
12488
|
+
if (Is.has(e)) return Is.get(e);
|
|
12489
|
+
let t = _s("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
|
|
12443
12490
|
new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
|
|
12444
12491
|
})).catch((t) => {
|
|
12445
|
-
throw
|
|
12492
|
+
throw Is.delete(e), t;
|
|
12446
12493
|
});
|
|
12447
|
-
return
|
|
12494
|
+
return Is.set(e, t), t;
|
|
12448
12495
|
}
|
|
12449
|
-
function
|
|
12496
|
+
function Rs(e, t) {
|
|
12450
12497
|
let n = new e.Box3().setFromObject(t);
|
|
12451
12498
|
if (n.isEmpty()) return t;
|
|
12452
12499
|
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();
|
|
12453
12500
|
return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
|
|
12454
12501
|
}
|
|
12455
|
-
var
|
|
12502
|
+
var zs = {
|
|
12456
12503
|
box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
|
|
12457
12504
|
sphere: (e) => new e.SphereGeometry(.62, 48, 32),
|
|
12458
12505
|
torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
|
|
@@ -12461,50 +12508,50 @@ var Is = {
|
|
|
12461
12508
|
cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
|
|
12462
12509
|
plane: (e) => new e.PlaneGeometry(1.4, 1.4),
|
|
12463
12510
|
capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
|
|
12464
|
-
},
|
|
12465
|
-
function
|
|
12466
|
-
let g = u(null), [_, v] = d(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !
|
|
12511
|
+
}, Bs = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
|
|
12512
|
+
function Vs({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: a, controls: o, ground: c, height: l, style: f, nodeRef: p, inert: m }) {
|
|
12513
|
+
let g = u(null), [_, v] = d(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !ys(), S = o !== !1 && !m;
|
|
12467
12514
|
return s(() => {
|
|
12468
12515
|
let e = g.current;
|
|
12469
12516
|
if (!e) return;
|
|
12470
12517
|
let i = !0, o = null;
|
|
12471
|
-
return
|
|
12518
|
+
return gs().then((s) => {
|
|
12472
12519
|
if (!i || !e) return;
|
|
12473
12520
|
let l = new s.WebGLRenderer({
|
|
12474
12521
|
antialias: !0,
|
|
12475
12522
|
alpha: !t
|
|
12476
12523
|
});
|
|
12477
|
-
l.setPixelRatio(
|
|
12524
|
+
l.setPixelRatio(bs()), l.shadowMap.enabled = c !== !1, l.shadowMap.type = s.PCFSoftShadowMap, l.outputColorSpace = s.SRGBColorSpace, l.toneMapping = s.ACESFilmicToneMapping, l.domElement.style.display = "block", l.domElement.style.width = "100%", l.domElement.style.height = "100%", e.appendChild(l.domElement);
|
|
12478
12525
|
let u = new s.Scene();
|
|
12479
|
-
t && (u.background = new s.Color(t)), u.environment =
|
|
12480
|
-
let d = new s.PerspectiveCamera(
|
|
12481
|
-
distance:
|
|
12526
|
+
t && (u.background = new s.Color(t)), u.environment = Fs(s, l);
|
|
12527
|
+
let d = new s.PerspectiveCamera(Bs(r, 45), 1, .1, 400), f = Ss(d, l.domElement, {
|
|
12528
|
+
distance: Bs(n, 5),
|
|
12482
12529
|
enableZoom: S
|
|
12483
12530
|
}), p = new s.DirectionalLight(16777215, 2.2);
|
|
12484
12531
|
p.position.set(4, 7, 5), p.castShadow = c !== !1, p.shadow.mapSize.set(1024, 1024), p.shadow.camera.near = .5, p.shadow.camera.far = 30, u.add(p, new s.AmbientLight(16777215, .35));
|
|
12485
12532
|
let m = [], h = new s.Group(), g = (e, t) => {
|
|
12486
|
-
let n =
|
|
12487
|
-
e.position.set(
|
|
12533
|
+
let n = Bs(t.scale, 1);
|
|
12534
|
+
e.position.set(Bs(t.x, 0), Bs(t.y, 0), Bs(t.z, 0)), e.rotation.set(Ts(t.rx), Ts(t.ry), Ts(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = Ts(t.spin);
|
|
12488
12535
|
};
|
|
12489
12536
|
for (let e of y) {
|
|
12490
12537
|
if (e.shape === "model") {
|
|
12491
|
-
if (!
|
|
12538
|
+
if (!Es(e.src)) continue;
|
|
12492
12539
|
let t = new s.Group();
|
|
12493
|
-
g(t, e), h.add(t),
|
|
12540
|
+
g(t, e), h.add(t), Ls(e.src).then((e) => {
|
|
12494
12541
|
if (!i) return;
|
|
12495
|
-
let n =
|
|
12542
|
+
let n = Rs(s, e.clone(!0));
|
|
12496
12543
|
n.traverse((e) => {
|
|
12497
12544
|
e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
|
|
12498
12545
|
}), t.add(n);
|
|
12499
12546
|
}, () => {});
|
|
12500
12547
|
continue;
|
|
12501
12548
|
}
|
|
12502
|
-
let t = (
|
|
12549
|
+
let t = (zs[e.shape] ?? zs.box)(s), n = new s.MeshStandardMaterial({
|
|
12503
12550
|
color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
|
|
12504
|
-
metalness: Math.min(1, Math.max(0,
|
|
12505
|
-
roughness: Math.min(1, Math.max(0,
|
|
12506
|
-
transparent:
|
|
12507
|
-
opacity: Math.min(1, Math.max(0,
|
|
12551
|
+
metalness: Math.min(1, Math.max(0, ws(e.metalness, 10))),
|
|
12552
|
+
roughness: Math.min(1, Math.max(0, ws(e.roughness, 35))),
|
|
12553
|
+
transparent: ws(e.opacity, 100) < 1,
|
|
12554
|
+
opacity: Math.min(1, Math.max(0, ws(e.opacity, 100))),
|
|
12508
12555
|
flatShading: e.flat === !0,
|
|
12509
12556
|
wireframe: e.wireframe === !0,
|
|
12510
12557
|
side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
|
|
@@ -12515,14 +12562,14 @@ function Rs({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
12515
12562
|
let _ = null;
|
|
12516
12563
|
if (c !== !1) {
|
|
12517
12564
|
let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
|
|
12518
|
-
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y =
|
|
12565
|
+
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = Bs(c === !0 ? 0 : c, -.85), _.receiveShadow = !0, u.add(_), m.push(t, e);
|
|
12519
12566
|
}
|
|
12520
12567
|
let v = () => {
|
|
12521
12568
|
let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
|
|
12522
12569
|
l.setSize(t, n, !1), d.aspect = t / n, d.updateProjectionMatrix();
|
|
12523
12570
|
}, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
|
|
12524
12571
|
b?.observe(e), v();
|
|
12525
|
-
let C =
|
|
12572
|
+
let C = Ts(Number.isFinite(Number(a)) ? a : 20), w = xs(e, (e) => {
|
|
12526
12573
|
f.autoSpin(x ? C : 0, e), f.update();
|
|
12527
12574
|
for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
|
|
12528
12575
|
l.render(u, d);
|
|
@@ -12546,7 +12593,7 @@ function Rs({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
12546
12593
|
a,
|
|
12547
12594
|
S,
|
|
12548
12595
|
c
|
|
12549
|
-
]), _ && m ? /* @__PURE__ */ h(
|
|
12596
|
+
]), _ && m ? /* @__PURE__ */ h(Ds, {
|
|
12550
12597
|
nodeRef: p,
|
|
12551
12598
|
style: f,
|
|
12552
12599
|
height: l,
|
|
@@ -12557,27 +12604,27 @@ function Rs({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
12557
12604
|
g.current = e, typeof p == "function" && p(e);
|
|
12558
12605
|
},
|
|
12559
12606
|
style: {
|
|
12560
|
-
minHeight:
|
|
12561
|
-
height:
|
|
12607
|
+
minHeight: Cs(l, 380),
|
|
12608
|
+
height: Cs(l, 380),
|
|
12562
12609
|
overflow: "hidden",
|
|
12563
12610
|
touchAction: S ? "pan-y" : void 0,
|
|
12564
12611
|
...U(f)
|
|
12565
12612
|
}
|
|
12566
12613
|
});
|
|
12567
12614
|
}
|
|
12568
|
-
function
|
|
12615
|
+
function Hs({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a }) {
|
|
12569
12616
|
let o = u(null), [c, l] = d("");
|
|
12570
12617
|
return s(() => {
|
|
12571
12618
|
let t = o.current;
|
|
12572
12619
|
if (a || !t || typeof e != "string" || !e.trim()) return;
|
|
12573
12620
|
let r = !0, i = null;
|
|
12574
|
-
return
|
|
12621
|
+
return gs().then((a) => {
|
|
12575
12622
|
if (!r || !t) return;
|
|
12576
12623
|
let o = new a.WebGLRenderer({
|
|
12577
12624
|
antialias: !0,
|
|
12578
12625
|
alpha: !n
|
|
12579
12626
|
});
|
|
12580
|
-
o.setPixelRatio(
|
|
12627
|
+
o.setPixelRatio(bs()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
|
|
12581
12628
|
let s = new a.Scene();
|
|
12582
12629
|
n && (s.background = new a.Color(n));
|
|
12583
12630
|
let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
|
|
@@ -12600,7 +12647,7 @@ function zs({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
|
|
|
12600
12647
|
o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
|
|
12601
12648
|
}, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
|
|
12602
12649
|
f?.observe(t), d();
|
|
12603
|
-
let p = !1, m =
|
|
12650
|
+
let p = !1, m = xs(t, (e, t) => {
|
|
12604
12651
|
if (!p && typeof u?.frame == "function") try {
|
|
12605
12652
|
u.frame(e, t);
|
|
12606
12653
|
} catch (e) {
|
|
@@ -12622,7 +12669,7 @@ function zs({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
|
|
|
12622
12669
|
e,
|
|
12623
12670
|
a,
|
|
12624
12671
|
n
|
|
12625
|
-
]), a ? /* @__PURE__ */ h(
|
|
12672
|
+
]), a ? /* @__PURE__ */ h(Ds, {
|
|
12626
12673
|
nodeRef: i,
|
|
12627
12674
|
style: r,
|
|
12628
12675
|
height: t,
|
|
@@ -12633,8 +12680,8 @@ function zs({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
|
|
|
12633
12680
|
o.current = e, typeof i == "function" && i(e);
|
|
12634
12681
|
},
|
|
12635
12682
|
style: {
|
|
12636
|
-
minHeight:
|
|
12637
|
-
height:
|
|
12683
|
+
minHeight: Cs(t, 380),
|
|
12684
|
+
height: Cs(t, 380),
|
|
12638
12685
|
overflow: "hidden",
|
|
12639
12686
|
position: "relative",
|
|
12640
12687
|
touchAction: "pan-y",
|
|
@@ -12657,30 +12704,30 @@ function zs({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
|
|
|
12657
12704
|
}) : null
|
|
12658
12705
|
});
|
|
12659
12706
|
}
|
|
12660
|
-
var
|
|
12661
|
-
ModelViewerBlock:
|
|
12662
|
-
ShaderBlock:
|
|
12663
|
-
SceneBlock:
|
|
12664
|
-
ThreeCanvasBlock:
|
|
12665
|
-
},
|
|
12707
|
+
var Us = {
|
|
12708
|
+
ModelViewerBlock: Os,
|
|
12709
|
+
ShaderBlock: Ps,
|
|
12710
|
+
SceneBlock: Vs,
|
|
12711
|
+
ThreeCanvasBlock: Hs
|
|
12712
|
+
}, Ws = "2.44.0", Gs = "https://cdn.jsdelivr.net/npm", Ks = `${Gs}/@rive-app/canvas@${Ws}/+esm`, qs = `${Gs}/@rive-app/canvas@${Ws}/rive.wasm`, Js = (e) => import(
|
|
12666
12713
|
/* @vite-ignore */
|
|
12667
12714
|
/* webpackIgnore: true */
|
|
12668
12715
|
e
|
|
12669
|
-
),
|
|
12670
|
-
function
|
|
12671
|
-
return typeof window > "u" ? new Promise(() => {}) :
|
|
12716
|
+
), Ys = null;
|
|
12717
|
+
function Xs() {
|
|
12718
|
+
return typeof window > "u" ? new Promise(() => {}) : Ys || (Ys = Js(Ks).then((e) => {
|
|
12672
12719
|
let t = e?.default ?? e;
|
|
12673
|
-
return t?.RuntimeLoader?.setWasmUrl && t.RuntimeLoader.setWasmUrl(
|
|
12720
|
+
return t?.RuntimeLoader?.setWasmUrl && t.RuntimeLoader.setWasmUrl(qs), t;
|
|
12674
12721
|
}).catch((e) => {
|
|
12675
|
-
throw
|
|
12676
|
-
}),
|
|
12722
|
+
throw Ys = null, e;
|
|
12723
|
+
}), Ys);
|
|
12677
12724
|
}
|
|
12678
|
-
var
|
|
12725
|
+
var Zs = /* @__PURE__ */ new Map(), Qs = {
|
|
12679
12726
|
56: "number",
|
|
12680
12727
|
58: "trigger",
|
|
12681
12728
|
59: "boolean"
|
|
12682
|
-
},
|
|
12683
|
-
function
|
|
12729
|
+
}, $s = /* @__PURE__ */ new Set();
|
|
12730
|
+
function ec(e, t) {
|
|
12684
12731
|
if (!e || !t) return;
|
|
12685
12732
|
let n = (Array.isArray(t.artboards) ? t.artboards : []).map((e) => ({
|
|
12686
12733
|
name: String(e?.name ?? ""),
|
|
@@ -12689,15 +12736,15 @@ function Zs(e, t) {
|
|
|
12689
12736
|
name: String(e?.name ?? ""),
|
|
12690
12737
|
inputs: (Array.isArray(e?.inputs) ? e.inputs : []).map((e) => ({
|
|
12691
12738
|
name: String(e?.name ?? ""),
|
|
12692
|
-
type:
|
|
12739
|
+
type: Qs[e?.type] ?? "unknown"
|
|
12693
12740
|
}))
|
|
12694
12741
|
}))
|
|
12695
12742
|
}));
|
|
12696
|
-
|
|
12743
|
+
Zs.set(e, { artboards: n }), $s.forEach((t) => t(e));
|
|
12697
12744
|
}
|
|
12698
12745
|
//#endregion
|
|
12699
12746
|
//#region ../ui/src/components/builder/rive/views.jsx
|
|
12700
|
-
var
|
|
12747
|
+
var tc = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, nc = [
|
|
12701
12748
|
"contain",
|
|
12702
12749
|
"cover",
|
|
12703
12750
|
"fill",
|
|
@@ -12706,7 +12753,7 @@ var Qs = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t,
|
|
|
12706
12753
|
"scaleDown",
|
|
12707
12754
|
"none",
|
|
12708
12755
|
"layout"
|
|
12709
|
-
],
|
|
12756
|
+
], rc = [
|
|
12710
12757
|
"center",
|
|
12711
12758
|
"topLeft",
|
|
12712
12759
|
"topCenter",
|
|
@@ -12716,8 +12763,8 @@ var Qs = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t,
|
|
|
12716
12763
|
"bottomLeft",
|
|
12717
12764
|
"bottomCenter",
|
|
12718
12765
|
"bottomRight"
|
|
12719
|
-
],
|
|
12720
|
-
function
|
|
12766
|
+
], ic = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, ac = 131;
|
|
12767
|
+
function oc(e, t, n, r) {
|
|
12721
12768
|
if (!e || !t || !n) return;
|
|
12722
12769
|
let i = [];
|
|
12723
12770
|
try {
|
|
@@ -12728,15 +12775,15 @@ function rc(e, t, n, r) {
|
|
|
12728
12775
|
let a = i.find((e) => e?.name === n);
|
|
12729
12776
|
a && (a.type === 58 ? r && a.fire() : a.type === 59 ? a.value = !!r : a.type === 56 && (a.value = +!!r));
|
|
12730
12777
|
}
|
|
12731
|
-
function
|
|
12778
|
+
function sc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o = "stateMachine", stateMachine: c, animation: l, fit: f = "contain", alignment: p = "center", autoplay: m = !0, hoverInput: _, clickInput: v, style: y, nodeRef: b, inert: x }) {
|
|
12732
12779
|
let S = u(null), C = u(null), w = u(null), T = u(""), [E, D] = d(!1), [O, k] = d(!1);
|
|
12733
12780
|
s(() => {
|
|
12734
12781
|
let t = C.current, n = S.current;
|
|
12735
12782
|
if (D(!1), k(!1), !e || !t) return;
|
|
12736
12783
|
let r = !0, i = null, s = null, u = null;
|
|
12737
|
-
return
|
|
12784
|
+
return Xs().then((d) => {
|
|
12738
12785
|
if (!r) return;
|
|
12739
|
-
let h = o !== "animation", g = m !== !1 && !
|
|
12786
|
+
let h = o !== "animation", g = m !== !1 && !ic();
|
|
12740
12787
|
try {
|
|
12741
12788
|
i = new d.Rive({
|
|
12742
12789
|
src: e,
|
|
@@ -12746,8 +12793,8 @@ function ic({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
|
|
|
12746
12793
|
animations: !h && l ? l : void 0,
|
|
12747
12794
|
autoplay: g,
|
|
12748
12795
|
layout: new d.Layout({
|
|
12749
|
-
fit:
|
|
12750
|
-
alignment:
|
|
12796
|
+
fit: nc.includes(f) ? f : "contain",
|
|
12797
|
+
alignment: rc.includes(p) ? p : "center"
|
|
12751
12798
|
}),
|
|
12752
12799
|
shouldDisableRiveListeners: !!x,
|
|
12753
12800
|
isTouchScrollEnabled: !0,
|
|
@@ -12755,7 +12802,7 @@ function ic({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
|
|
|
12755
12802
|
if (!r) return;
|
|
12756
12803
|
i.resizeDrawingSurfaceToCanvas();
|
|
12757
12804
|
let t = i.contents;
|
|
12758
|
-
if (
|
|
12805
|
+
if (ec(e, t), h) {
|
|
12759
12806
|
let e = ((t?.artboards ?? []).find((e) => e.name === (a || i.activeArtboard)) ?? t?.artboards?.[0])?.stateMachines?.[0]?.name ?? "";
|
|
12760
12807
|
if (T.current = c || e, !c && e) try {
|
|
12761
12808
|
i.play(e), g || i.pause(e);
|
|
@@ -12771,7 +12818,7 @@ function ic({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
|
|
|
12771
12818
|
}
|
|
12772
12819
|
w.current = i, n && (n.rive = i), i.on(d.EventType.RiveEvent, (e) => {
|
|
12773
12820
|
let t = e?.data;
|
|
12774
|
-
x || t?.type !==
|
|
12821
|
+
x || t?.type !== ac || !t?.url || (t.target === "_self" ? window.location.assign(t.url) : window.open(t.url, t.target || "_blank", "noopener"));
|
|
12775
12822
|
}), n && typeof ResizeObserver < "u" && (s = new ResizeObserver(() => i?.resizeDrawingSurfaceToCanvas()), s.observe(n)), n && typeof IntersectionObserver < "u" && (u = new IntersectionObserver(([e]) => {
|
|
12776
12823
|
i && (e?.isIntersecting ? i.startRendering?.() : i.stopRendering?.());
|
|
12777
12824
|
}), u.observe(n));
|
|
@@ -12792,11 +12839,11 @@ function ic({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
|
|
|
12792
12839
|
m,
|
|
12793
12840
|
x
|
|
12794
12841
|
]);
|
|
12795
|
-
let A = !x && E, j = (e, t) => A &&
|
|
12842
|
+
let A = !x && E, j = (e, t) => A && oc(w.current, T.current, e, t), M = {
|
|
12796
12843
|
position: "relative",
|
|
12797
12844
|
display: "block",
|
|
12798
12845
|
width: "100%",
|
|
12799
|
-
height:
|
|
12846
|
+
height: tc(r, 360),
|
|
12800
12847
|
backgroundColor: i || "transparent",
|
|
12801
12848
|
overflow: "hidden",
|
|
12802
12849
|
...U(y)
|
|
@@ -12858,35 +12905,35 @@ function ic({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
|
|
|
12858
12905
|
}), /* @__PURE__ */ h("span", { children: "Pick a .riv file in the Settings panel." })]
|
|
12859
12906
|
}) : null;
|
|
12860
12907
|
}
|
|
12861
|
-
var
|
|
12862
|
-
function
|
|
12863
|
-
if (
|
|
12908
|
+
var cc = { RiveBlock: sc }, lc = /* @__PURE__ */ new Map();
|
|
12909
|
+
function uc(e) {
|
|
12910
|
+
if (lc.has(e)) return lc.get(e);
|
|
12864
12911
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
12865
12912
|
/* @vite-ignore */
|
|
12866
12913
|
/* webpackIgnore: true */
|
|
12867
12914
|
t
|
|
12868
12915
|
).finally(() => URL.revokeObjectURL(t));
|
|
12869
|
-
return
|
|
12916
|
+
return lc.set(e, n), n;
|
|
12870
12917
|
}
|
|
12871
|
-
function
|
|
12918
|
+
function dc(e) {
|
|
12872
12919
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
12873
12920
|
return n && typeof n == "object" ? n : {};
|
|
12874
12921
|
}
|
|
12875
12922
|
//#endregion
|
|
12876
12923
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
12877
|
-
async function
|
|
12878
|
-
let n = await
|
|
12924
|
+
async function fc(e, t) {
|
|
12925
|
+
let n = await uc(e);
|
|
12879
12926
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
12880
12927
|
}
|
|
12881
|
-
var
|
|
12928
|
+
var pc = {
|
|
12882
12929
|
padding: "10px 12px",
|
|
12883
12930
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
12884
12931
|
borderRadius: 8,
|
|
12885
12932
|
fontSize: 12,
|
|
12886
12933
|
opacity: .6
|
|
12887
12934
|
};
|
|
12888
|
-
function
|
|
12889
|
-
let a = o(Y), c =
|
|
12935
|
+
function mc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
|
|
12936
|
+
let a = o(Y), c = dc(a?.settings)[e], l = u(null), d = u(null), f = {
|
|
12890
12937
|
tenant: a?.tenant ?? "",
|
|
12891
12938
|
apiUrl: a?.apiUrl ?? "/api",
|
|
12892
12939
|
locale: a?.locale ?? "",
|
|
@@ -12898,7 +12945,7 @@ function dc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
|
|
|
12898
12945
|
let e = l.current;
|
|
12899
12946
|
if (!c?.code || !e) return;
|
|
12900
12947
|
let n = !0;
|
|
12901
|
-
return
|
|
12948
|
+
return fc(c.code, t).then((e) => {
|
|
12902
12949
|
if (!(!n || !e || !l.current)) {
|
|
12903
12950
|
d.current = e;
|
|
12904
12951
|
try {
|
|
@@ -12928,7 +12975,7 @@ function dc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
|
|
|
12928
12975
|
}) : /* @__PURE__ */ g("div", {
|
|
12929
12976
|
ref: i,
|
|
12930
12977
|
style: {
|
|
12931
|
-
...
|
|
12978
|
+
...pc,
|
|
12932
12979
|
...U(r)
|
|
12933
12980
|
},
|
|
12934
12981
|
children: [
|
|
@@ -12940,7 +12987,7 @@ function dc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
|
|
|
12940
12987
|
}
|
|
12941
12988
|
//#endregion
|
|
12942
12989
|
//#region ../ui/src/components/builder/render.jsx
|
|
12943
|
-
function
|
|
12990
|
+
function hc(e, t) {
|
|
12944
12991
|
let n = { "data-wb": e };
|
|
12945
12992
|
t.htmlId && (n.id = t.htmlId);
|
|
12946
12993
|
let r = G(t.classNames);
|
|
@@ -12954,7 +13001,7 @@ function fc(e, t) {
|
|
|
12954
13001
|
classes: r
|
|
12955
13002
|
};
|
|
12956
13003
|
}
|
|
12957
|
-
function
|
|
13004
|
+
function gc({ View: e, markup: n, ...r }) {
|
|
12958
13005
|
let a = e(r);
|
|
12959
13006
|
if (!i(a) || typeof a.type != "string") return a;
|
|
12960
13007
|
let o = [a.props.className, ...n.classes].filter(Boolean).join(" ");
|
|
@@ -12963,14 +13010,14 @@ function pc({ View: e, markup: n, ...r }) {
|
|
|
12963
13010
|
...o ? { className: o } : {}
|
|
12964
13011
|
});
|
|
12965
13012
|
}
|
|
12966
|
-
var
|
|
12967
|
-
...
|
|
12968
|
-
...
|
|
12969
|
-
...
|
|
12970
|
-
...
|
|
12971
|
-
PluginBlock:
|
|
13013
|
+
var _c = {
|
|
13014
|
+
...ta,
|
|
13015
|
+
...ss,
|
|
13016
|
+
...Us,
|
|
13017
|
+
...cc,
|
|
13018
|
+
PluginBlock: mc
|
|
12972
13019
|
};
|
|
12973
|
-
function
|
|
13020
|
+
function vc(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
12974
13021
|
let o = n[t];
|
|
12975
13022
|
if (!o || o.hidden) return null;
|
|
12976
13023
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -12978,19 +13025,19 @@ function hc(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
12978
13025
|
let n = o.props?.componentId, s = r?.[n];
|
|
12979
13026
|
if (!s?.template || i.has(n)) return null;
|
|
12980
13027
|
let l = new Set(i).add(n);
|
|
12981
|
-
return /* @__PURE__ */ h(e, { children:
|
|
13028
|
+
return /* @__PURE__ */ h(e, { children: vc(s.template.rootId, s.template.nodes, r, l, et(c.values, a)) }, t);
|
|
12982
13029
|
}
|
|
12983
|
-
let l =
|
|
13030
|
+
let l = _c[s];
|
|
12984
13031
|
if (!l) return null;
|
|
12985
|
-
let u = (o.nodes ?? []).map((e) =>
|
|
13032
|
+
let u = (o.nodes ?? []).map((e) => vc(e, n, r, i, a)).filter(Boolean), d = Object.entries(o.linkedNodes ?? {}), f = d.length ? Object.fromEntries(d.map(([e, t]) => [e, vc(t, n, r, i, a)])) : void 0, p = /* @__PURE__ */ h(typeof l == "function" ? gc : l, {
|
|
12986
13033
|
...typeof l == "function" ? {
|
|
12987
13034
|
View: l,
|
|
12988
|
-
markup:
|
|
13035
|
+
markup: hc(t, c)
|
|
12989
13036
|
} : null,
|
|
12990
13037
|
...c,
|
|
12991
13038
|
...s === "CollectionList" ? {
|
|
12992
13039
|
templateId: o.linkedNodes?.card,
|
|
12993
|
-
renderTemplate: o.linkedNodes?.card ? (e) =>
|
|
13040
|
+
renderTemplate: o.linkedNodes?.card ? (e) => vc(o.linkedNodes.card, n, r, i, {
|
|
12994
13041
|
...a,
|
|
12995
13042
|
mapProps: a?.mapProps ? (t, n) => a.mapProps(e(t, n), n) : e
|
|
12996
13043
|
}) : void 0
|
|
@@ -13000,7 +13047,7 @@ function hc(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
13000
13047
|
e && (e.setAttribute("data-wb", t), le(e, c), ce(e, a?.events === !1 ? [] : c.events));
|
|
13001
13048
|
},
|
|
13002
13049
|
children: u.length ? u : void 0
|
|
13003
|
-
}, t), m = c.when && c.when !== "always" ? /* @__PURE__ */ h(
|
|
13050
|
+
}, t), m = c.when && c.when !== "always" ? /* @__PURE__ */ h(da, {
|
|
13004
13051
|
when: c.when,
|
|
13005
13052
|
children: p
|
|
13006
13053
|
}, t) : p;
|
|
@@ -13011,9 +13058,9 @@ function hc(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
13011
13058
|
}
|
|
13012
13059
|
//#endregion
|
|
13013
13060
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
13014
|
-
var
|
|
13061
|
+
var yc = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), bc = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(Pe(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
13015
13062
|
.webim-page[data-webim-mode="dark"] { ${Object.entries(Pe(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
13016
|
-
function
|
|
13063
|
+
function xc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: a, animations: o, tenant: c, apiUrl: u, datasets: d, locale: f, direction: p, settings: m, siteUser: _, param: v }) {
|
|
13017
13064
|
let y = a?.js?.trim(), b = m && m["site.code"] && typeof m["site.code"] == "object" ? m["site.code"] : null, S = typeof b?.js == "string" ? b.js.trim() : "", C = typeof b?.css == "string" ? b.css.trim() : "";
|
|
13018
13065
|
if (s(() => {
|
|
13019
13066
|
if (!S) return;
|
|
@@ -13031,11 +13078,11 @@ function vc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
13031
13078
|
minHeight: "100%",
|
|
13032
13079
|
display: "flex",
|
|
13033
13080
|
flexDirection: "column"
|
|
13034
|
-
}, O =
|
|
13081
|
+
}, O = vc("ROOT", e, n), k = l(() => ({ render: (t, r) => vc(t, e, n, void 0, { mapProps: r }) }), [e, n]), A = q(e, n), j = Ce(e, n), M = a?.css?.trim(), N = B(o), P = Ne(t), F = [P.font, P.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !Ae[e]), I = [.../* @__PURE__ */ new Set([...w(e, n), ...F])].map((e) => /* @__PURE__ */ h("link", {
|
|
13035
13082
|
rel: "stylesheet",
|
|
13036
13083
|
precedence: "default",
|
|
13037
13084
|
href: x(e)
|
|
13038
|
-
}, e)), L =
|
|
13085
|
+
}, e)), L = bc(P), R = ze(t);
|
|
13039
13086
|
return r === "auto" ? /* @__PURE__ */ h(Y.Provider, {
|
|
13040
13087
|
value: {
|
|
13041
13088
|
tenant: c || "",
|
|
@@ -13044,7 +13091,7 @@ function vc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
13044
13091
|
settings: m ?? null,
|
|
13045
13092
|
param: v || ""
|
|
13046
13093
|
},
|
|
13047
|
-
children: /* @__PURE__ */ h(
|
|
13094
|
+
children: /* @__PURE__ */ h(ua, {
|
|
13048
13095
|
initialUser: _,
|
|
13049
13096
|
children: /* @__PURE__ */ h(Ft.Provider, {
|
|
13050
13097
|
value: d ?? null,
|
|
@@ -13059,8 +13106,8 @@ function vc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
13059
13106
|
...i
|
|
13060
13107
|
},
|
|
13061
13108
|
children: [
|
|
13062
|
-
/* @__PURE__ */ h("style", { children: `.webim-page { ${
|
|
13063
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
13109
|
+
/* @__PURE__ */ h("style", { children: `.webim-page { ${yc(Pe(P.light))} }
|
|
13110
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${yc(Pe(P.dark))} } }` }),
|
|
13064
13111
|
/* @__PURE__ */ h("style", { children: L }),
|
|
13065
13112
|
I,
|
|
13066
13113
|
/* @__PURE__ */ h("style", { children: E }),
|
|
@@ -13083,7 +13130,7 @@ function vc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
13083
13130
|
settings: m ?? null,
|
|
13084
13131
|
param: v || ""
|
|
13085
13132
|
},
|
|
13086
|
-
children: /* @__PURE__ */ h(
|
|
13133
|
+
children: /* @__PURE__ */ h(ua, {
|
|
13087
13134
|
initialUser: _,
|
|
13088
13135
|
children: /* @__PURE__ */ h(Ft.Provider, {
|
|
13089
13136
|
value: d ?? null,
|
|
@@ -13117,8 +13164,8 @@ function vc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
13117
13164
|
}
|
|
13118
13165
|
//#endregion
|
|
13119
13166
|
//#region src/WebimContent.jsx
|
|
13120
|
-
function
|
|
13121
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ h(
|
|
13167
|
+
function Sc({ bundle: e, mode: t = "auto", style: n }) {
|
|
13168
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ h(xc, {
|
|
13122
13169
|
blocks: e.blocks,
|
|
13123
13170
|
theme: e.theme,
|
|
13124
13171
|
components: e.components,
|
|
@@ -13137,7 +13184,7 @@ function yc({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
13137
13184
|
}
|
|
13138
13185
|
//#endregion
|
|
13139
13186
|
//#region src/WebimPage.jsx
|
|
13140
|
-
function
|
|
13187
|
+
function Cc({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, mode: o = "auto", style: c, fallback: l = null, errorFallback: f = null, onLoad: p, onError: m }) {
|
|
13141
13188
|
let [g, _] = d({ status: "loading" }), v = u({
|
|
13142
13189
|
onLoad: p,
|
|
13143
13190
|
onError: m
|
|
@@ -13174,11 +13221,11 @@ function bc({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, mo
|
|
|
13174
13221
|
r,
|
|
13175
13222
|
i,
|
|
13176
13223
|
a
|
|
13177
|
-
]), g.status === "loading" ? l : g.status === "error" ? typeof f == "function" ? f(g.error) : f : /* @__PURE__ */ h(
|
|
13224
|
+
]), g.status === "loading" ? l : g.status === "error" ? typeof f == "function" ? f(g.error) : f : /* @__PURE__ */ h(Sc, {
|
|
13178
13225
|
bundle: g.bundle,
|
|
13179
13226
|
mode: o,
|
|
13180
13227
|
style: c
|
|
13181
13228
|
});
|
|
13182
13229
|
}
|
|
13183
13230
|
//#endregion
|
|
13184
|
-
export {
|
|
13231
|
+
export { xc as PageRenderer, Sc as WebimContent, Cc as WebimPage, qe as fetchPage, Dn as renderRichContent, Ue as resolveTheme };
|