webim-adapter 2.11.0 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2346,12 +2346,12 @@ function fr(e, t, n) {
2346
2346
  return r ? e.filter((e) => dr(e, t).includes(r)) : [];
2347
2347
  }
2348
2348
  function pr(e, t, n) {
2349
- return !e || !t ? [] : Go(vr(e.data, t)).map((r, i) => ({
2349
+ return !e || !t ? [] : Yo(vr(e.data, t)).map((r, i) => ({
2350
2350
  ...e,
2351
2351
  id: `${e.id ?? "entry"}:${t}:${i}`,
2352
2352
  data: {
2353
2353
  ...e.data ?? {},
2354
- [t]: Zo(r, n?.[r], i)
2354
+ [t]: ts(r, n?.[r], i)
2355
2355
  }
2356
2356
  }));
2357
2357
  }
@@ -3753,7 +3753,7 @@ function Fi({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
3753
3753
  })
3754
3754
  })
3755
3755
  ] })]
3756
- });
3756
+ }, "live");
3757
3757
  }
3758
3758
  var Ii = (e) => typeof e == "string" && e.startsWith(":"), Li = (e, t) => ({
3759
3759
  position: "absolute",
@@ -5639,7 +5639,7 @@ function ja({ style: e, action: t, method: n, name: r, enctype: i, formSlug: a,
5639
5639
  display: z === "success" ? "none" : "flex"
5640
5640
  },
5641
5641
  children: l && a ? /* @__PURE__ */ g(m, { children: [
5642
- W && /* @__PURE__ */ h(vo, {
5642
+ W && /* @__PURE__ */ h(So, {
5643
5643
  steps: U.map((e) => ({ label: e.section?.label ?? B("start") })),
5644
5644
  active: G + 1,
5645
5645
  style: { marginBottom: 8 }
@@ -6093,7 +6093,7 @@ function qa(e, t, n = "asc", r) {
6093
6093
  }).map(({ row: e }) => e);
6094
6094
  }
6095
6095
  function Ja({ 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, itemsOf: b, sortBy: x = "", sortDir: S = "asc", gap: C, style: w, nodeRef: T }) {
6096
- let { tenant: E, apiUrl: D, revision: O, locale: k } = o(Z), A = o(lr), j = o(ar), M = o(ur), N = typeof b == "string" && b ? b : null, P = Xo(N ? Go(vr(M?.entry?.data, N)) : null), F = y || N ? null : e, I = !!_ && !y && !N, L = typeof x == "string" && x !== "" && !N, [, R] = d(0);
6096
+ let { tenant: E, apiUrl: D, revision: O, locale: k } = o(Z), A = o(lr), j = o(ar), M = o(ur), N = typeof b == "string" && b ? b : null, P = es(N ? Yo(vr(M?.entry?.data, N)) : null), F = y || N ? null : e, I = !!_ && !y && !N, L = typeof x == "string" && x !== "" && !N, [, R] = d(0);
6097
6097
  s(() => {
6098
6098
  if (typeof window > "u") return;
6099
6099
  let e = () => R((e) => e + 1);
@@ -6949,7 +6949,258 @@ function mo({ from: e, to: t, duration: n, delay: r, decimals: i, prefix: a, suf
6949
6949
  }) : null]
6950
6950
  });
6951
6951
  }
6952
- function ho({ 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 }) {
6952
+ var ho = "@keyframes wb-type-blink { 50% { opacity: 0; } }";
6953
+ function go({ phrases: e, tag: t, typeSpeed: n, deleteSpeed: r, hold: i, pause: a, startDelay: o, loop: c, caret: l, caretColor: u, style: f, nodeRef: p, inert: m }) {
6954
+ let _ = (Array.isArray(e) ? e : []).map((e) => typeof e == "string" ? e : e?.text).filter((e) => typeof e == "string" && e.length), v = _[0] ?? "", [y, b] = d(v), x = [
6955
+ "h1",
6956
+ "h2",
6957
+ "h3",
6958
+ "h4",
6959
+ "h5",
6960
+ "h6",
6961
+ "p",
6962
+ "span",
6963
+ "div"
6964
+ ].includes(t) ? t : "p", S = (e, t) => Number.isFinite(Number(e)) && e !== "" && e != null ? Math.max(0, Number(e)) : t, C = {
6965
+ type: S(n, 55),
6966
+ erase: S(r, 35),
6967
+ hold: S(i, 1700),
6968
+ pause: S(a, 380),
6969
+ start: S(o, 400)
6970
+ };
6971
+ s(() => {
6972
+ if (m || typeof window > "u" || !_.length) {
6973
+ b(v);
6974
+ return;
6975
+ }
6976
+ if (!document.getElementById("wb-typewriter-css")) {
6977
+ let e = document.createElement("style");
6978
+ e.id = "wb-typewriter-css", e.textContent = ho, document.head.appendChild(e);
6979
+ }
6980
+ if (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches) {
6981
+ b(v);
6982
+ return;
6983
+ }
6984
+ let e = 0, t = 0, n = !1, r = 0, i = () => {
6985
+ let a = _[e];
6986
+ t += n ? -1 : 1, b(a.slice(0, t));
6987
+ let o = n ? C.erase : C.type;
6988
+ if (!n && t >= a.length) {
6989
+ if (c === !1 && e === _.length - 1 || _.length === 1 && c === !1) return;
6990
+ n = !0, o = C.hold;
6991
+ } else n && t <= 0 && (n = !1, e = (e + 1) % _.length, o = C.pause);
6992
+ r = setTimeout(i, o);
6993
+ };
6994
+ return b(""), r = setTimeout(i, C.start), () => clearTimeout(r);
6995
+ }, [
6996
+ m,
6997
+ _.join("\0"),
6998
+ C.type,
6999
+ C.erase,
7000
+ C.hold,
7001
+ C.pause,
7002
+ C.start,
7003
+ c
7004
+ ]);
7005
+ let w = l === "none" ? null : {
7006
+ display: "inline-block",
7007
+ width: l === "bar" ? "2px" : "0.55em",
7008
+ height: "1.05em",
7009
+ marginLeft: l === "bar" ? "2px" : "4px",
7010
+ verticalAlign: "text-bottom",
7011
+ background: typeof u == "string" && u ? u : "var(--page-accent, #3b82f6)",
7012
+ animation: m ? "none" : "wb-type-blink 1s step-end infinite"
7013
+ };
7014
+ return /* @__PURE__ */ g(x, {
7015
+ ref: p,
7016
+ style: {
7017
+ margin: 0,
7018
+ ...Y(f)
7019
+ },
7020
+ children: [
7021
+ /* @__PURE__ */ h("span", {
7022
+ "aria-hidden": "true",
7023
+ ...Q("text"),
7024
+ children: y.length || !m ? y : v
7025
+ }),
7026
+ w && /* @__PURE__ */ h("span", {
7027
+ "aria-hidden": "true",
7028
+ ...Q("caret"),
7029
+ style: w
7030
+ }),
7031
+ _.length > 0 && /* @__PURE__ */ h("span", {
7032
+ style: Tt,
7033
+ children: _.map((e) => /[.!?…:;]$/.test(e.trim()) ? e.trim() : `${e.trim()}.`).join(" ")
7034
+ })
7035
+ ]
7036
+ });
7037
+ }
7038
+ var _o = "a, button, [role=\"button\"], input[type=\"submit\"], label, summary, .magnetic, .tag";
7039
+ function vo({ dotSize: e, ringSize: t, color: n, blend: r, trail: i, grow: a, hideNative: o, hover: l, magnetic: f, strength: p, shape: m, anchor: _, showRing: v, linked: y, style: b, nodeRef: x, inert: S }) {
7040
+ let C = m === "custom", w = v !== !1, T = _ === "top-left", E = `wb-cur-${c().replace(/[^a-zA-Z0-9_-]/g, "")}`, D = u(null), O = u(null), k = u(null), [A, j] = d(!1), M = Math.max(2, Number(e) || 7), N = Math.max(8, Number(t) || 34), P = typeof n == "string" && n ? n : "#ffffff", F = typeof r == "string" && r ? r : "difference", I = Math.max(1, (Number(a) || 180) / 100), L = Math.min(1, Math.max(.02, (Number(i) || 18) / 100)), R = Math.max(0, Number.isFinite(Number(p)) && p !== "" && p != null ? Number(p) : 30) / 100, z = typeof l == "string" && l.trim() ? l : _o;
7041
+ return s(() => {
7042
+ if (S || typeof window > "u" || !window.matchMedia) return;
7043
+ let e = window.matchMedia("(hover: hover) and (pointer: fine)"), t = () => j(e.matches);
7044
+ return t(), e.addEventListener?.("change", t), () => e.removeEventListener?.("change", t);
7045
+ }, [S]), s(() => {
7046
+ let e = D.current, t = O.current, n = k.current;
7047
+ if (S || !A || !e || !t || !n) return;
7048
+ let r = e.closest(".webim-page, .wb-artboard") || document.documentElement, i = window.matchMedia("(prefers-reduced-motion: reduce)").matches, a = 0, s = 0, c = 0, l = 0, u = !1, d = !1, p = 1, m = 0, h = null;
7049
+ o !== !1 && r.classList.add(E);
7050
+ let g = () => {
7051
+ let r = e.getBoundingClientRect();
7052
+ c += (a - c) * (i ? 1 : L), l += (s - l) * (i ? 1 : L), p += ((d ? I : 1) - p) * (i ? 1 : .2);
7053
+ let o = C ? t.offsetWidth : M, u = C ? t.offsetHeight : M, f = T ? 0 : o / 2, h = T ? 0 : u / 2;
7054
+ t.style.transform = `translate(${a - r.left - f}px, ${s - r.top - h}px)`, n.style.transform = `translate(${c - r.left - N / 2}px, ${l - r.top - N / 2}px) scale(${p.toFixed(3)})`, m = requestAnimationFrame(g);
7055
+ }, _ = (e) => {
7056
+ t.style.opacity = e ? "1" : "0", n.style.opacity = e ? "1" : "0";
7057
+ }, v = () => {
7058
+ h && (h.style.translate = ""), h = null;
7059
+ }, y = (e) => {
7060
+ a = e.clientX, s = e.clientY;
7061
+ let t = r.contains(e.target);
7062
+ if (u ||= (c = a, l = s, !0), _(t), d = t && !!e.target?.closest?.(z), f === !1) return;
7063
+ let n = t ? e.target?.closest?.(".magnetic") : null;
7064
+ if (n !== h && v(), !n || i) return;
7065
+ let o = n.getBoundingClientRect();
7066
+ h = n, n.style.translate = `${((a - (o.left + o.width / 2)) * R * .83).toFixed(1)}px ${((s - (o.top + o.height / 2)) * R * 1.17).toFixed(1)}px`;
7067
+ }, b = (e) => {
7068
+ e.relatedTarget || (_(!1), v());
7069
+ };
7070
+ return _(!1), m = requestAnimationFrame(g), document.addEventListener("pointermove", y, { passive: !0 }), document.addEventListener("pointerout", b, { passive: !0 }), () => {
7071
+ cancelAnimationFrame(m), document.removeEventListener("pointermove", y), document.removeEventListener("pointerout", b), r.classList.remove(E), v();
7072
+ };
7073
+ }, [
7074
+ S,
7075
+ A,
7076
+ E,
7077
+ o,
7078
+ M,
7079
+ N,
7080
+ L,
7081
+ I,
7082
+ z,
7083
+ f,
7084
+ R,
7085
+ C,
7086
+ T
7087
+ ]), S ? /* @__PURE__ */ g("div", {
7088
+ ref: x,
7089
+ style: {
7090
+ ...Ze,
7091
+ display: "inline-flex",
7092
+ alignItems: "center",
7093
+ gap: 8,
7094
+ padding: "6px 10px",
7095
+ border: "1px dashed rgba(148, 163, 184, .6)",
7096
+ borderRadius: 8,
7097
+ fontSize: 12,
7098
+ color: "rgba(148, 163, 184, 1)",
7099
+ ...Y(b)
7100
+ },
7101
+ children: [
7102
+ /* @__PURE__ */ h("span", {
7103
+ style: {
7104
+ position: "relative",
7105
+ width: 18,
7106
+ height: 18,
7107
+ borderRadius: "50%",
7108
+ border: "1px solid currentColor",
7109
+ display: "inline-block"
7110
+ },
7111
+ children: /* @__PURE__ */ h("span", { style: {
7112
+ position: "absolute",
7113
+ left: 6,
7114
+ top: 6,
7115
+ width: 4,
7116
+ height: 4,
7117
+ borderRadius: "50%",
7118
+ background: "currentColor"
7119
+ } })
7120
+ }),
7121
+ "Custom cursor",
7122
+ C && /* @__PURE__ */ h("div", {
7123
+ style: {
7124
+ marginLeft: 6,
7125
+ padding: 6,
7126
+ border: "1px dashed rgba(148, 163, 184, .6)",
7127
+ borderRadius: 6,
7128
+ minWidth: 40,
7129
+ minHeight: 24
7130
+ },
7131
+ children: y?.content
7132
+ })
7133
+ ]
7134
+ }, "edit") : /* @__PURE__ */ g("div", {
7135
+ ref: (e) => {
7136
+ D.current = e, typeof x == "function" && x(e);
7137
+ },
7138
+ "aria-hidden": "true",
7139
+ style: {
7140
+ position: "fixed",
7141
+ left: 0,
7142
+ top: 0,
7143
+ width: 0,
7144
+ height: 0,
7145
+ zIndex: 2147482500,
7146
+ pointerEvents: "none"
7147
+ },
7148
+ children: [
7149
+ A && o !== !1 && /* @__PURE__ */ h("style", { children: `.${E}, .${E} * { cursor: none !important; }` }),
7150
+ /* @__PURE__ */ h("div", {
7151
+ ref: k,
7152
+ ...Q("ring"),
7153
+ style: {
7154
+ position: "absolute",
7155
+ left: 0,
7156
+ top: 0,
7157
+ width: N,
7158
+ height: N,
7159
+ borderRadius: "50%",
7160
+ border: `1px solid ${P}`,
7161
+ mixBlendMode: F,
7162
+ opacity: 0,
7163
+ transition: "opacity .25s",
7164
+ willChange: "transform",
7165
+ display: A && w ? "block" : "none"
7166
+ }
7167
+ }),
7168
+ C ? /* @__PURE__ */ h("div", {
7169
+ ref: O,
7170
+ ...Q("content"),
7171
+ style: {
7172
+ position: "absolute",
7173
+ left: 0,
7174
+ top: 0,
7175
+ width: "max-content",
7176
+ opacity: 0,
7177
+ transition: "opacity .25s",
7178
+ willChange: "transform",
7179
+ display: A ? "block" : "none"
7180
+ },
7181
+ children: y?.content
7182
+ }) : /* @__PURE__ */ h("div", {
7183
+ ref: O,
7184
+ ...Q("dot"),
7185
+ style: {
7186
+ position: "absolute",
7187
+ left: 0,
7188
+ top: 0,
7189
+ width: M,
7190
+ height: M,
7191
+ borderRadius: "50%",
7192
+ background: P,
7193
+ mixBlendMode: F,
7194
+ opacity: 0,
7195
+ transition: "opacity .25s",
7196
+ willChange: "transform",
7197
+ display: A ? "block" : "none"
7198
+ }
7199
+ })
7200
+ ]
7201
+ });
7202
+ }
7203
+ function yo({ 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 }) {
6953
7204
  let [_, v] = d(!!f), [y, b] = d(null), x = (e) => {
6954
7205
  b(e), typeof u == "function" && u(e);
6955
7206
  };
@@ -7051,7 +7302,7 @@ function ho({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
7051
7302
  }) : null]
7052
7303
  });
7053
7304
  }
7054
- var go = {
7305
+ var bo = {
7055
7306
  facebook: {
7056
7307
  label: "Facebook",
7057
7308
  color: "#1877f2",
@@ -7118,8 +7369,8 @@ var go = {
7118
7369
  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"
7119
7370
  }
7120
7371
  };
7121
- function _o({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
7122
- let l = Array.isArray(e) ? e.filter((e) => e && go[e.network]) : [];
7372
+ function xo({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
7373
+ let l = Array.isArray(e) ? e.filter((e) => e && bo[e.network]) : [];
7123
7374
  if (!l.length) return null;
7124
7375
  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;
7125
7376
  return /* @__PURE__ */ h("div", {
@@ -7132,7 +7383,7 @@ function _o({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
7132
7383
  ...Y(o)
7133
7384
  },
7134
7385
  children: l.map((e, r) => {
7135
- let i = go[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);
7386
+ let i = bo[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);
7136
7387
  return /* @__PURE__ */ h("a", {
7137
7388
  ...Q("link", /^[a-z]+$/.test(e.network ?? "") && `link-${e.network}`),
7138
7389
  href: e.url || "#",
@@ -7168,7 +7419,7 @@ function _o({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
7168
7419
  })
7169
7420
  });
7170
7421
  }
7171
- function vo({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
7422
+ function So({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
7172
7423
  if (!t.length) return null;
7173
7424
  let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
7174
7425
  width: 32,
@@ -7251,7 +7502,7 @@ function vo({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
7251
7502
  })
7252
7503
  });
7253
7504
  }
7254
- var yo = {
7505
+ var Co = {
7255
7506
  small: {
7256
7507
  w: 132,
7257
7508
  h: 46,
@@ -7273,25 +7524,25 @@ var yo = {
7273
7524
  title: 12.5,
7274
7525
  avatar: 46
7275
7526
  }
7276
- }, bo = (e) => yo[e] ?? yo.medium;
7277
- yo.medium.w, yo.medium.h;
7278
- var xo = (e) => String(e?.group ?? "").trim(), So = (e) => {
7527
+ }, wo = (e) => Co[e] ?? Co.medium;
7528
+ Co.medium.w, Co.medium.h;
7529
+ var To = (e) => String(e?.group ?? "").trim(), Eo = (e) => {
7279
7530
  let t = [], n = /* @__PURE__ */ new Map();
7280
7531
  return e.forEach((e, r) => {
7281
- let i = xo(e) || `#${r}`;
7532
+ let i = To(e) || `#${r}`;
7282
7533
  n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
7283
7534
  }), t.flatMap((e) => n.get(e));
7284
- }, Co = 20, wo = 12, To = [
7535
+ }, Do = 20, Oo = 12, ko = [
7285
7536
  "left",
7286
7537
  "center",
7287
7538
  "right"
7288
- ], Eo = (e) => e.points.map((e, t) => `${t ? "L" : "M"} ${e.x} ${e.y}`).join(" ");
7289
- function Do(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top", columns: i = "off" } = {}) {
7290
- let a = bo(t), o = n ? a.h : a.w, s = n ? 16 : 20, c = (n ? a.w : a.h) + (n ? 56 : 48), l = Array.isArray(e) ? e.filter((e) => e && e.id) : [], u = new Set(l.map((e) => e.id)), d = /* @__PURE__ */ new Map(), f = [];
7539
+ ], Ao = (e) => e.points.map((e, t) => `${t ? "L" : "M"} ${e.x} ${e.y}`).join(" ");
7540
+ function jo(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top", columns: i = "off" } = {}) {
7541
+ let a = wo(t), o = n ? a.h : a.w, s = n ? 16 : 20, c = (n ? a.w : a.h) + (n ? 56 : 48), l = Array.isArray(e) ? e.filter((e) => e && e.id) : [], u = new Set(l.map((e) => e.id)), d = /* @__PURE__ */ new Map(), f = [];
7291
7542
  for (let e of l) e.parent && u.has(e.parent) && e.parent !== e.id ? (d.has(e.parent) || d.set(e.parent, []), d.get(e.parent).push(e)) : f.push(e);
7292
- f = So(f);
7293
- for (let [e, t] of d) d.set(e, So(t));
7294
- let p = !n && To.includes(i), m = (e) => To.includes(e?.columns) ? e.columns : i, h = (e) => {
7543
+ f = Eo(f);
7544
+ for (let [e, t] of d) d.set(e, Eo(t));
7545
+ let p = !n && ko.includes(i), m = (e) => ko.includes(e?.columns) ? e.columns : i, h = (e) => {
7295
7546
  let t = d.get(e.id) ?? [];
7296
7547
  if (!p) return t.map((e) => ({ nodes: [e] }));
7297
7548
  let n = [], r = [], i = () => {
@@ -7302,10 +7553,10 @@ function Do(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top",
7302
7553
  };
7303
7554
  for (let e of t) {
7304
7555
  let t = !(d.get(e.id) ?? []).length;
7305
- r.length && (!t || xo(r[0]) !== xo(e)) && i(), t ? r.push(e) : n.push({ nodes: [e] });
7556
+ r.length && (!t || To(r[0]) !== To(e)) && i(), t ? r.push(e) : n.push({ nodes: [e] });
7306
7557
  }
7307
7558
  return i(), n;
7308
- }, g = (e, t) => s + (xo(e) !== xo(t) && (xo(e) || xo(t)) ? 24 : 0), _ = (e, t) => g(e.nodes.at(-1), t.nodes[0]), v = (e) => o + (e.line === "center" ? 0 : Co), y = /* @__PURE__ */ new Map(), b = (e, t) => {
7559
+ }, g = (e, t) => s + (To(e) !== To(t) && (To(e) || To(t)) ? 24 : 0), _ = (e, t) => g(e.nodes.at(-1), t.nodes[0]), v = (e) => o + (e.line === "center" ? 0 : Do), y = /* @__PURE__ */ new Map(), b = (e, t) => {
7309
7560
  if (t.has(e.id)) return 0;
7310
7561
  t.add(e.id);
7311
7562
  let n = h(e), r = n.reduce((e, r, i) => {
@@ -7321,7 +7572,7 @@ function Do(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top",
7321
7572
  x: t,
7322
7573
  y: r
7323
7574
  });
7324
- let i = xo(e);
7575
+ let i = To(e);
7325
7576
  if (i) {
7326
7577
  let n = `${e.parent && u.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${i}`;
7327
7578
  C.has(n) || C.set(n, {
@@ -7337,12 +7588,12 @@ function Do(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top",
7337
7588
  }
7338
7589
  w = Math.max(w, n ? t + a.w : r + a.h);
7339
7590
  }, E = (e, t, n, r) => {
7340
- let i = t + (e.line === "left" ? Co : 0), o = n * c, s = r.y + (o - r.y) / 2, l = e.line === "left" ? i - Co / 2 : i + a.w + Co / 2;
7591
+ let i = t + (e.line === "left" ? Do : 0), o = n * c, s = r.y + (o - r.y) / 2, l = e.line === "left" ? i - Do / 2 : i + a.w + Do / 2;
7341
7592
  e.nodes.forEach((t, n) => {
7342
- let c = o + n * (a.h + wo), u = c + a.h / 2;
7593
+ let c = o + n * (a.h + Oo), u = c + a.h / 2;
7343
7594
  if (T(t, i, c), e.line === "center") S.push(n ? { points: [{
7344
7595
  x: i + a.w / 2,
7345
- y: c - wo
7596
+ y: c - Oo
7346
7597
  }, {
7347
7598
  x: i + a.w / 2,
7348
7599
  y: c
@@ -7464,18 +7715,18 @@ function Do(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top",
7464
7715
  horizontal: n
7465
7716
  };
7466
7717
  }
7467
- var Oo = (e, t) => {
7718
+ var Mo = (e, t) => {
7468
7719
  let n = String(e ?? "");
7469
7720
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
7470
- }, ko = (e) => {
7721
+ }, No = (e) => {
7471
7722
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
7472
7723
  if (!t) return "#ffffff";
7473
7724
  let n = t[1];
7474
7725
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
7475
7726
  let r = parseInt(n, 16);
7476
7727
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
7477
- }, Ao = (e) => !!(e?.cv?.trim?.() || e?.photo || e?.profilePhoto || e?.profile?.length);
7478
- function jo(e, t = {}) {
7728
+ }, Po = (e) => !!(e?.cv?.trim?.() || e?.photo || e?.profilePhoto || e?.profile?.length);
7729
+ function Fo(e, t = {}) {
7479
7730
  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 ? "" : br(e);
7480
7731
  return n.map((e) => {
7481
7732
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
@@ -7491,21 +7742,21 @@ function jo(e, t = {}) {
7491
7742
  };
7492
7743
  });
7493
7744
  }
7494
- var Mo = /^(https?:\/\/[^\s"<>]+|mailto:[^\s"<>]+|tel:[+\d][\d\s().-]*|\/(?!\/)[^\s"<>]*)$/i, No = (e) => {
7745
+ var Io = /^(https?:\/\/[^\s"<>]+|mailto:[^\s"<>]+|tel:[+\d][\d\s().-]*|\/(?!\/)[^\s"<>]*)$/i, Lo = (e) => {
7495
7746
  let t = String(e ?? "").trim();
7496
- return Mo.test(t) ? t : "";
7497
- }, Po = (e) => {
7747
+ return Io.test(t) ? t : "";
7748
+ }, Ro = (e) => {
7498
7749
  e.startsWith("/") ? window.location.assign(e) : window.open(e, "_blank", "noopener,noreferrer");
7499
- }, Fo = {
7750
+ }, zo = {
7500
7751
  size: 36,
7501
7752
  pad: 10
7502
7753
  };
7503
- function Io({ node: e, onClose: t }) {
7754
+ function Bo({ node: e, onClose: t }) {
7504
7755
  s(() => {
7505
7756
  let e = (e) => e.key === "Escape" && t();
7506
7757
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
7507
7758
  }, [t]);
7508
- let n = e.profile?.length ? e.profile : null, r = n ? "" : e.profilePhoto || e.photo, i = e.title || e.name, a = e.title && e.name ? e.name : "", o = !!(n || r && e.cv), c = No(e.href);
7759
+ let n = e.profile?.length ? e.profile : null, r = n ? "" : e.profilePhoto || e.photo, i = e.title || e.name, a = e.title && e.name ? e.name : "", o = !!(n || r && e.cv), c = Lo(e.href);
7509
7760
  return /* @__PURE__ */ h("div", {
7510
7761
  onClick: t,
7511
7762
  role: "dialog",
@@ -7654,10 +7905,10 @@ function Io({ node: e, onClose: t }) {
7654
7905
  })
7655
7906
  });
7656
7907
  }
7657
- function Lo(e) {
7658
- return e.chart?.people?.length ? /* @__PURE__ */ h(Ro, { ...e }) : /* @__PURE__ */ h(zo, { ...e });
7908
+ function Vo(e) {
7909
+ return e.chart?.people?.length ? /* @__PURE__ */ h(Ho, { ...e }) : /* @__PURE__ */ h(Uo, { ...e });
7659
7910
  }
7660
- function Ro({ chart: e, profiles: t, style: n, nodeRef: r, interactive: i = !0 }) {
7911
+ function Ho({ chart: e, profiles: t, style: n, nodeRef: r, interactive: i = !0 }) {
7661
7912
  let [a, o] = d(null), s = l(() => In(e), [e]), c = l(() => new Set(e.people.map((e) => e.parent)), [e]);
7662
7913
  return /* @__PURE__ */ g("div", {
7663
7914
  ref: r,
@@ -7707,7 +7958,7 @@ function Ro({ chart: e, profiles: t, style: n, nodeRef: r, interactive: i = !0 }
7707
7958
  profilePhoto: n.photo,
7708
7959
  href: n.link,
7709
7960
  profile: u
7710
- }, f = No(n.link), p = i && (f || Ao(d)), m = () => f ? Po(f) : o(d);
7961
+ }, f = Lo(n.link), p = i && (f || Po(d)), m = () => f ? Ro(f) : o(d);
7711
7962
  return /* @__PURE__ */ h("g", {
7712
7963
  onClick: p ? m : void 0,
7713
7964
  onKeyDown: p ? (e) => {
@@ -7733,13 +7984,13 @@ function Ro({ chart: e, profiles: t, style: n, nodeRef: r, interactive: i = !0 }
7733
7984
  }, n.id);
7734
7985
  })
7735
7986
  ]
7736
- }), a && /* @__PURE__ */ h(Io, {
7987
+ }), a && /* @__PURE__ */ h(Bo, {
7737
7988
  node: a,
7738
7989
  onClose: () => o(null)
7739
7990
  })]
7740
7991
  });
7741
7992
  }
7742
- function zo({ 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, columns: b = "off", style: x, nodeRef: S, interactive: C = !0 }) {
7993
+ function Uo({ 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, columns: b = "off", style: x, nodeRef: S, interactive: C = !0 }) {
7743
7994
  let w = c(), [T, E] = d(null), { tenant: D, apiUrl: O, revision: k } = o(Z), A = o(ar)?.[t], [j, M] = d(null);
7744
7995
  s(() => {
7745
7996
  if (!t || A) return;
@@ -7757,7 +8008,7 @@ function zo({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
7757
8008
  O,
7758
8009
  A
7759
8010
  ]);
7760
- let N = t ? jo(A ?? j ?? [], {
8011
+ let N = t ? Fo(A ?? j ?? [], {
7761
8012
  nameField: n,
7762
8013
  titleField: r,
7763
8014
  photoField: i,
@@ -7765,7 +8016,7 @@ function zo({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
7765
8016
  cvField: l,
7766
8017
  hrefField: u,
7767
8018
  groupField: f
7768
- }) : e, P = bo(v), { boxes: F, links: I, groups: L, width: R, height: z } = Do(N, {
8019
+ }) : e, P = wo(v), { boxes: F, links: I, groups: L, width: R, height: z } = jo(N, {
7769
8020
  size: v,
7770
8021
  horizontal: y,
7771
8022
  groupTitles: p,
@@ -7824,18 +8075,18 @@ function zo({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
7824
8075
  fontSize: P.title + 1,
7825
8076
  fontWeight: "600",
7826
8077
  opacity: "0.55",
7827
- fill: r ? ko(e.color || _) : "var(--page-text, #111827)",
7828
- children: Oo(e.title, Math.floor(e.width / 7))
8078
+ fill: r ? No(e.color || _) : "var(--page-text, #111827)",
8079
+ children: Mo(e.title, Math.floor(e.width / 7))
7829
8080
  })] }, `group-${t}`);
7830
8081
  }),
7831
8082
  I.map((e, t) => /* @__PURE__ */ h("path", {
7832
- d: Eo(e),
8083
+ d: Ao(e),
7833
8084
  fill: "none",
7834
8085
  stroke: "rgba(148, 163, 184, 0.7)",
7835
8086
  strokeWidth: "1.5"
7836
8087
  }, t)),
7837
8088
  F.map(({ node: e, x: t, y: n }) => {
7838
- let r = B.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 ? ko(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? ko(e.color2) : s, l = No(e.href), u = C && (l || Ao(e)), d = () => l ? Po(l) : E(e), f = e.photo ? t + Fo.pad + P.avatar + 8 : t + P.w / 2, p = e.photo ? "start" : "middle", _ = e.photo ? Math.floor((P.w - P.avatar - 26) / 7) : Math.floor(P.w / 7.6), v = P.h / 2, y = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
8089
+ let r = B.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 ? No(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? No(e.color2) : s, l = Lo(e.href), u = C && (l || Po(e)), d = () => l ? Ro(l) : E(e), f = e.photo ? t + zo.pad + P.avatar + 8 : t + P.w / 2, p = e.photo ? "start" : "middle", _ = e.photo ? Math.floor((P.w - P.avatar - 26) / 7) : Math.floor(P.w / 7.6), v = P.h / 2, y = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
7839
8090
  return /* @__PURE__ */ g("g", {
7840
8091
  onClick: u ? d : void 0,
7841
8092
  onKeyDown: u ? (e) => {
@@ -7903,13 +8154,13 @@ function zo({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
7903
8154
  e.photo && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("clipPath", {
7904
8155
  id: `${w}-${e.id}`,
7905
8156
  children: /* @__PURE__ */ h("circle", {
7906
- cx: t + Fo.pad + P.avatar / 2,
8157
+ cx: t + zo.pad + P.avatar / 2,
7907
8158
  cy: n + P.h / 2,
7908
8159
  r: P.avatar / 2
7909
8160
  })
7910
8161
  }), /* @__PURE__ */ h("image", {
7911
8162
  href: e.photo,
7912
- x: t + Fo.pad,
8163
+ x: t + zo.pad,
7913
8164
  y: n + (P.h - P.avatar) / 2,
7914
8165
  width: P.avatar,
7915
8166
  height: P.avatar,
@@ -7923,7 +8174,7 @@ function zo({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
7923
8174
  fontSize: P.title,
7924
8175
  fontWeight: "600",
7925
8176
  fill: s,
7926
- children: Oo(e.title, _ + 4)
8177
+ children: Mo(e.title, _ + 4)
7927
8178
  }), e.name && /* @__PURE__ */ h("text", {
7928
8179
  x: f,
7929
8180
  y: n + v + v / 2 + P.name * .35,
@@ -7931,7 +8182,7 @@ function zo({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
7931
8182
  fontSize: P.name,
7932
8183
  fontWeight: "600",
7933
8184
  fill: c,
7934
- children: Oo(e.name, _)
8185
+ children: Mo(e.name, _)
7935
8186
  })] }) : /* @__PURE__ */ g(m, { children: [y[0] && /* @__PURE__ */ h("text", {
7936
8187
  x: f,
7937
8188
  y: n + (y[1] ? P.h * .43 : P.h * .57),
@@ -7939,7 +8190,7 @@ function zo({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
7939
8190
  fontSize: P.name,
7940
8191
  fontWeight: "600",
7941
8192
  fill: s,
7942
- children: Oo(y[0], _)
8193
+ children: Mo(y[0], _)
7943
8194
  }), y[1] && /* @__PURE__ */ h("text", {
7944
8195
  x: f,
7945
8196
  y: n + P.h * .73,
@@ -7947,19 +8198,19 @@ function zo({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
7947
8198
  fontSize: P.title,
7948
8199
  opacity: "0.7",
7949
8200
  fill: s,
7950
- children: Oo(y[1], _ + 4)
8201
+ children: Mo(y[1], _ + 4)
7951
8202
  })] })
7952
8203
  ]
7953
8204
  }, e.id);
7954
8205
  })
7955
8206
  ]
7956
- }), T && /* @__PURE__ */ h(Io, {
8207
+ }), T && /* @__PURE__ */ h(Bo, {
7957
8208
  node: T,
7958
8209
  onClose: () => E(null)
7959
8210
  })]
7960
8211
  });
7961
8212
  }
7962
- function Bo({ value: e, onCommit: t, style: n, hint: r }) {
8213
+ function Wo({ value: e, onCommit: t, style: n, hint: r }) {
7963
8214
  let [i, a] = d(!1), o = u(null);
7964
8215
  return s(() => {
7965
8216
  if (!i || !o.current) return;
@@ -7989,7 +8240,7 @@ function Bo({ value: e, onCommit: t, style: n, hint: r }) {
7989
8240
  children: e ?? ""
7990
8241
  });
7991
8242
  }
7992
- var Vo = 360, Ho = "\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", Uo = (e, t) => e && t ? `cell-${e}-${t}` : "", Wo = (e) => {
8243
+ var Go = 360, Ko = "\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", qo = (e, t) => e && t ? `cell-${e}-${t}` : "", Jo = (e) => {
7993
8244
  if (!e || typeof e != "object") return e ?? "";
7994
8245
  let t = String(e.text ?? "");
7995
8246
  return typeof e.href == "string" && e.href ? /* @__PURE__ */ h("a", {
@@ -7999,7 +8250,7 @@ var Vo = 360, Ho = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
7999
8250
  style: { color: "var(--page-accent, #4f46e5)" },
8000
8251
  children: t
8001
8252
  }) : t;
8002
- }, Go = (e) => (Array.isArray(e) ? e : e == null ? [] : [e]).map((e) => typeof e == "string" ? e : e?.url).filter((e) => typeof e == "string" && e.trim()), Ko = (e) => {
8253
+ }, Yo = (e) => (Array.isArray(e) ? e : e == null ? [] : [e]).map((e) => typeof e == "string" ? e : e?.url).filter((e) => typeof e == "string" && e.trim()), Xo = (e) => {
8003
8254
  if (!Number.isFinite(e) || e < 0) return "";
8004
8255
  if (e < 1024) return `${e} B`;
8005
8256
  let t = [
@@ -8012,27 +8263,27 @@ var Vo = 360, Ho = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
8012
8263
  n /= 1024, r++;
8013
8264
  while (n >= 1024 && r < t.length - 1);
8014
8265
  return `${n.toFixed(1)} ${t[r]}`;
8015
- }, qo = (e) => {
8266
+ }, Zo = (e) => {
8016
8267
  try {
8017
8268
  let t = new URL(e, typeof window > "u" ? "http://localhost" : window.location.href), n = t.pathname.match(/^(.*\/files\/[0-9a-f-]{36})\/?$/i);
8018
8269
  return n ? (t.pathname = `${n[1]}/meta`, t.toString()) : null;
8019
8270
  } catch {
8020
8271
  return null;
8021
8272
  }
8022
- }, Jo = /* @__PURE__ */ new Map(), Yo = (e) => {
8023
- let t = qo(e);
8273
+ }, Qo = /* @__PURE__ */ new Map(), $o = (e) => {
8274
+ let t = Zo(e);
8024
8275
  if (!t) return Promise.resolve(null);
8025
- if (!Jo.has(t)) {
8276
+ if (!Qo.has(t)) {
8026
8277
  let e = (e) => fetch(t, { credentials: e }).then((e) => e.ok ? e.json() : null);
8027
- Jo.set(t, e("include").catch(() => e("omit")).then((e) => e?.payload ?? null).catch(() => null).then((e) => (e || Jo.delete(t), e)));
8278
+ Qo.set(t, e("include").catch(() => e("omit")).then((e) => e?.payload ?? null).catch(() => null).then((e) => (e || Qo.delete(t), e)));
8028
8279
  }
8029
- return Jo.get(t);
8280
+ return Qo.get(t);
8030
8281
  };
8031
- function Xo(e) {
8282
+ function es(e) {
8032
8283
  let [t, n] = d({});
8033
8284
  return s(() => {
8034
8285
  let t = !0;
8035
- for (let r of e ?? []) Yo(r).then((e) => t && n((t) => ({
8286
+ for (let r of e ?? []) $o(r).then((e) => t && n((t) => ({
8036
8287
  ...t,
8037
8288
  [r]: e
8038
8289
  })));
@@ -8041,11 +8292,11 @@ function Xo(e) {
8041
8292
  };
8042
8293
  }, [(e ?? []).join("\n")]), t;
8043
8294
  }
8044
- var Zo = (e, t, n) => {
8295
+ var ts = (e, t, n) => {
8045
8296
  let r = String(t?.name ?? ""), i = r.includes(".") ? r.split(".").pop() : String(t?.mime ?? "").split("/").pop();
8046
8297
  return {
8047
8298
  name: r,
8048
- size: Ko(Number(t?.size)),
8299
+ size: Xo(Number(t?.size)),
8049
8300
  bytes: Number.isFinite(Number(t?.size)) ? Number(t.size) : "",
8050
8301
  type: String(i ?? "").toUpperCase(),
8051
8302
  url: e,
@@ -8053,8 +8304,8 @@ var Zo = (e, t, n) => {
8053
8304
  index: n + 1
8054
8305
  };
8055
8306
  };
8056
- function Qo({ 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, valign: k, borderColor: A, maxHeight: j, caption: M = "", captionHidden: N = !1, rowHeaders: P = !1, repeat: F = "", renderCell: I, style: L, nodeRef: R, edit: z }) {
8057
- let B = u(null), V = o(ur), H = F && !f ? Go(vr(V?.entry?.data, F)) : null, U = Xo(H), W = u(null), [G, K] = d(null), [q, ee] = d(null), te = (e, t) => () => {
8307
+ function ns({ 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, valign: k, borderColor: A, maxHeight: j, caption: M = "", captionHidden: N = !1, rowHeaders: P = !1, repeat: F = "", renderCell: I, style: L, nodeRef: R, edit: z }) {
8308
+ let B = u(null), V = o(ur), H = F && !f ? Yo(vr(V?.entry?.data, F)) : null, U = es(H), W = u(null), [G, K] = d(null), [q, ee] = d(null), te = (e, t) => () => {
8058
8309
  K({
8059
8310
  r: e,
8060
8311
  c: t
@@ -8069,7 +8320,7 @@ function Qo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
8069
8320
  }
8070
8321
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
8071
8322
  top: r.bottom - n.top + 4,
8072
- left: Math.max(0, Math.min(r.left - n.left, n.width - Vo))
8323
+ left: Math.max(0, Math.min(r.left - n.left, n.width - Go))
8073
8324
  };
8074
8325
  (q?.top !== i.top || q?.left !== i.left) && ee(i);
8075
8326
  }), s(() => {
@@ -8101,7 +8352,7 @@ function Qo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
8101
8352
  ]), !e.length) return null;
8102
8353
  let ue = Math.max(1, Number(p) || 10), de = f ? C ? oe || f.startsWith("api:") ? (oe ?? ce ?? []).slice((se - 1) * ue, se * ue) : (ce ?? []).slice(0, ue) : (oe ?? ce ?? []).slice(0, ue) : null, fe = de ? de.map((t) => e.map((e) => br(vr(t?.data, e.field)))) : t, pe = !!f && !(f && !oe && ce === null) && fe.length === 0, me = H && I && fe.length ? [...H.map((e, t) => ({
8103
8354
  r: 0,
8104
- file: Zo(e, U[e], t)
8355
+ file: ts(e, U[e], t)
8105
8356
  })), ...fe.slice(1).map((e, t) => ({
8106
8357
  r: t + 1,
8107
8358
  file: null
@@ -8145,7 +8396,7 @@ function Qo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
8145
8396
  window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
8146
8397
  }, Ne = /* @__PURE__ */ new Set();
8147
8398
  c && fe.forEach((t, n) => e.forEach((e, t) => {
8148
- let a = c[Uo(r[n], i[t])];
8399
+ let a = c[qo(r[n], i[t])];
8149
8400
  if (!a) return;
8150
8401
  let o = Math.max(1, Number(a.c) || 1), s = Math.max(1, Number(a.r) || 1);
8151
8402
  for (let e = 0; e < s; e++) for (let r = 0; r < o; r++) (e || r) && Ne.add(`${n + e},${t + r}`);
@@ -8168,7 +8419,7 @@ function Qo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
8168
8419
  },
8169
8420
  onClick: n,
8170
8421
  children: e
8171
- }, t), X = G && G.r < fe.length && G.c < e.length ? G : null, Ie = (e, t) => z?.labels?.[e] ?? t, Le = X ? c?.[Uo(r[X.r], i[X.c])] : null, Re = Math.max(1, Number(Le?.c) || 1), ze = Math.max(1, Number(Le?.r) || 1);
8422
+ }, t), X = G && G.r < fe.length && G.c < e.length ? G : null, Ie = (e, t) => z?.labels?.[e] ?? t, Le = X ? c?.[qo(r[X.r], i[X.c])] : null, Re = Math.max(1, Number(Le?.c) || 1), ze = Math.max(1, Number(Le?.r) || 1);
8172
8423
  return /* @__PURE__ */ g("div", {
8173
8424
  ref: (e) => {
8174
8425
  W.current = e, typeof R == "function" && R(e);
@@ -8179,7 +8430,7 @@ function Qo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
8179
8430
  ...Ae
8180
8431
  },
8181
8432
  children: [
8182
- z && /* @__PURE__ */ h("style", { children: Ho }),
8433
+ z && /* @__PURE__ */ h("style", { children: Ko }),
8183
8434
  z && X && q && /* @__PURE__ */ g("div", {
8184
8435
  className: "wb-tedit-bar",
8185
8436
  style: {
@@ -8261,7 +8512,7 @@ function Qo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
8261
8512
  } : z ? { position: "relative" } : null,
8262
8513
  ...ye
8263
8514
  },
8264
- children: z ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(Bo, {
8515
+ children: z ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(Wo, {
8265
8516
  value: t.label ?? t,
8266
8517
  onCommit: (e) => z.header(n, e),
8267
8518
  hint: Ie("editCell", "Double-click to edit"),
@@ -8294,7 +8545,7 @@ function Qo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
8294
8545
  },
8295
8546
  children: e.map((e, a) => {
8296
8547
  if (Ne.has(`${t},${a}`)) return null;
8297
- let o = Uo(r[t], i[a]), u = n ? he(o, n) : l?.[o], d = c?.[o], f = Math.max(1, Number(d?.c) || 1), p = Math.max(1, Number(d?.r) || 1), m = P && a === 0 ? "th" : "td";
8548
+ let o = qo(r[t], i[a]), u = n ? he(o, n) : l?.[o], d = c?.[o], f = Math.max(1, Number(d?.c) || 1), p = Math.max(1, Number(d?.r) || 1), m = P && a === 0 ? "th" : "td";
8298
8549
  return /* @__PURE__ */ g(m, {
8299
8550
  ...Q("cell", m === "th" && "row-header"),
8300
8551
  scope: m === "th" ? "row" : void 0,
@@ -8314,7 +8565,7 @@ function Qo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
8314
8565
  ...z ? { position: "relative" } : null,
8315
8566
  ...ye
8316
8567
  },
8317
- children: [u ?? Wo(s?.[a]), z && je && /* @__PURE__ */ h("span", {
8568
+ children: [u ?? Jo(s?.[a]), z && je && /* @__PURE__ */ h("span", {
8318
8569
  className: "wb-tedit-rowgrip",
8319
8570
  title: Ie("rowHeight", "Drag to set the row height — double-click to fit the content"),
8320
8571
  onPointerDown: Pe(t),
@@ -8330,7 +8581,7 @@ function Qo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
8330
8581
  ]
8331
8582
  });
8332
8583
  }
8333
- var $o = {
8584
+ var rs = {
8334
8585
  small: {
8335
8586
  cell: 62,
8336
8587
  font: 10.5,
@@ -8355,8 +8606,8 @@ var $o = {
8355
8606
  pad: 8,
8356
8607
  gap: 4
8357
8608
  }
8358
- }, es = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, ts = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), ns = 366;
8359
- function rs(e, t = {}) {
8609
+ }, is = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, as = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), os = 366;
8610
+ function ss(e, t = {}) {
8360
8611
  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 ? "" : br(e), a = (e) => {
8361
8612
  let t = i(r(e)), n = t ? new Date(t) : null;
8362
8613
  return n && !Number.isNaN(n.getTime()) ? n : null;
@@ -8373,7 +8624,7 @@ function rs(e, t = {}) {
8373
8624
  } : null;
8374
8625
  }).filter(Boolean);
8375
8626
  }
8376
- function is(e) {
8627
+ function cs(e) {
8377
8628
  return (Array.isArray(e) ? e : []).map((e, t) => {
8378
8629
  let n = e?.start ? new Date(e.start) : null;
8379
8630
  if (!n || Number.isNaN(n.getTime())) return null;
@@ -8388,19 +8639,19 @@ function is(e) {
8388
8639
  };
8389
8640
  }).filter(Boolean);
8390
8641
  }
8391
- function as(e) {
8642
+ function ls(e) {
8392
8643
  let t = /* @__PURE__ */ new Map();
8393
8644
  for (let n of e) {
8394
- let e = ts(n.start), r = n.end ? ts(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), ns);
8645
+ let e = as(n.start), r = n.end ? as(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), os);
8395
8646
  for (let r = 0; r <= i; r += 1) {
8396
- let i = es(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
8647
+ let i = is(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
8397
8648
  t.has(i) || t.set(i, []), t.get(i).push(n);
8398
8649
  }
8399
8650
  }
8400
8651
  for (let e of t.values()) e.sort((e, t) => e.start - t.start);
8401
8652
  return t;
8402
8653
  }
8403
- function os({ 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 }) {
8654
+ function us({ 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 }) {
8404
8655
  let { tenant: T, apiUrl: E, revision: D, locale: O } = o(Z), k = o(ar)?.[t], [A, j] = d(null), [M, N] = d(() => {
8405
8656
  let e = /* @__PURE__ */ new Date();
8406
8657
  return {
@@ -8424,13 +8675,13 @@ function os({ events: e = [], source: t = "", titleField: n = "", startField: r
8424
8675
  E,
8425
8676
  k
8426
8677
  ]);
8427
- let P = $o[u] ?? $o.medium, F = f || "var(--page-accent, #4f46e5)", I = v || "var(--page-border, rgba(148, 163, 184, 0.35))", L = p || F, R = _ || "var(--page-accent-text, #ffffff)", z = t ? rs(k ?? A ?? [], {
8678
+ let P = rs[u] ?? rs.medium, F = f || "var(--page-accent, #4f46e5)", I = v || "var(--page-border, rgba(148, 163, 184, 0.35))", L = p || F, R = _ || "var(--page-accent-text, #ffffff)", z = t ? ss(k ?? A ?? [], {
8428
8679
  titleField: n,
8429
8680
  startField: r,
8430
8681
  endField: i,
8431
8682
  hrefField: a,
8432
8683
  colorField: c
8433
- }) : is(e), B = as(z), V = O || void 0, H = (e, t) => {
8684
+ }) : cs(e), B = ls(z), V = O || void 0, H = (e, t) => {
8434
8685
  let n = /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("span", {
8435
8686
  ...Q("event-dot"),
8436
8687
  style: {
@@ -8573,9 +8824,9 @@ function os({ events: e = [], source: t = "", titleField: n = "", startField: r
8573
8824
  })]
8574
8825
  });
8575
8826
  }
8576
- let q = new Date(M.year, M.month, 1), ee = y === "sunday" ? 0 : 1, te = (q.getDay() - ee + 7) % 7, J = new Date(M.year, M.month + 1, 0).getDate(), ne = Math.ceil((te + J) / 7), re = es(/* @__PURE__ */ new Date()), ie = new Intl.DateTimeFormat(V, { weekday: "short" }), ae = [];
8827
+ let q = new Date(M.year, M.month, 1), ee = y === "sunday" ? 0 : 1, te = (q.getDay() - ee + 7) % 7, J = new Date(M.year, M.month + 1, 0).getDate(), ne = Math.ceil((te + J) / 7), re = is(/* @__PURE__ */ new Date()), ie = new Intl.DateTimeFormat(V, { weekday: "short" }), ae = [];
8577
8828
  for (let e = 0; e < ne * 7; e += 1) {
8578
- let t = e - te + 1, n = t >= 1 && t <= J, r = es(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === re;
8829
+ let t = e - te + 1, n = t >= 1 && t <= J, r = is(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === re;
8579
8830
  ae.push(/* @__PURE__ */ g("div", {
8580
8831
  ...Q("day", !n && "day-outside", o && "day-today"),
8581
8832
  style: {
@@ -8645,12 +8896,12 @@ function os({ events: e = [], source: t = "", titleField: n = "", startField: r
8645
8896
  ]
8646
8897
  });
8647
8898
  }
8648
- var ss = {
8899
+ var ds = {
8649
8900
  small: 36,
8650
8901
  medium: 56,
8651
8902
  large: 88
8652
8903
  };
8653
- function cs(e, t = {}) {
8904
+ function fs(e, t = {}) {
8654
8905
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : br(e);
8655
8906
  return n.map((e) => {
8656
8907
  let n = e.data ?? e, i = vr(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(vr(n, t.nameField)) : r(n.name);
@@ -8661,7 +8912,7 @@ function cs(e, t = {}) {
8661
8912
  };
8662
8913
  }).filter((e) => e.src);
8663
8914
  }
8664
- function ls({ 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 }) {
8915
+ function ps({ 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 }) {
8665
8916
  let { tenant: D, apiUrl: O, revision: k, locale: A } = o(Z), j = wt(A), M = o(ar)?.[t], [N, P] = d(null), F = u(null), I = u(null), [L, R] = d(0), [z, B] = d(0), [V, H] = d(0), [U, W] = d(!0), [G, K] = d(!1), [q, ee] = d(!1), [te, J] = d(!1), [ne, re] = d(!1);
8666
8917
  s(() => {
8667
8918
  if (!t || M) return;
@@ -8702,11 +8953,11 @@ function ls({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
8702
8953
  t = !1, r.forEach((e) => e.removeEventListener("load", n));
8703
8954
  };
8704
8955
  });
8705
- let ie = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], ae = t ? cs(M ?? N ?? [], {
8956
+ let ie = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], ae = t ? fs(M ?? N ?? [], {
8706
8957
  imageField: n,
8707
8958
  nameField: r,
8708
8959
  hrefField: i
8709
- }) : ie, oe = ss[c] ?? ss.medium, se = Number.isFinite(Number(f)) ? Math.max(0, Number(f)) : 48, ce = a === "marquee" ? "step" : a, le = Math.min(3e4, Math.max(300, (Number(p) || 3) * 1e3)), ue = Math.min(3e3, Math.max(100, Number(_) || 500)), de = Math.min(12, Math.max(1, Math.round(Number(l) || 5))), fe = (z || oe * 3) + se, pe = L ? Math.max(1, Math.floor(L / fe)) : de, me = Math.min(de, pe), he = L ? Math.min(fe, L / me) : fe;
8960
+ }) : ie, oe = ds[c] ?? ds.medium, se = Number.isFinite(Number(f)) ? Math.max(0, Number(f)) : 48, ce = a === "marquee" ? "step" : a, le = Math.min(3e4, Math.max(300, (Number(p) || 3) * 1e3)), ue = Math.min(3e3, Math.max(100, Number(_) || 500)), de = Math.min(12, Math.max(1, Math.round(Number(l) || 5))), fe = (z || oe * 3) + se, pe = L ? Math.max(1, Math.floor(L / fe)) : de, me = Math.min(de, pe), he = L ? Math.min(fe, L / me) : fe;
8710
8961
  if (!ae.length) return /* @__PURE__ */ h("div", {
8711
8962
  ref: T,
8712
8963
  style: {
@@ -8923,7 +9174,7 @@ function ls({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
8923
9174
  children: /* @__PURE__ */ h("path", { d: te ? "M8 5v14l11-7z" : "M7 5h4v14H7zM13 5h4v14h-4z" })
8924
9175
  })
8925
9176
  }),
8926
- /* @__PURE__ */ h(us, {
9177
+ /* @__PURE__ */ h(ms, {
8927
9178
  running: ye,
8928
9179
  every: le + ue,
8929
9180
  slide: ue,
@@ -8937,7 +9188,7 @@ function ls({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
8937
9188
  ]
8938
9189
  });
8939
9190
  }
8940
- function us({ running: e, every: t, slide: n, step: r, index: i, total: a, home: o, setIndex: c, setAnimate: l }) {
9191
+ function ms({ running: e, every: t, slide: n, step: r, index: i, total: a, home: o, setIndex: c, setAnimate: l }) {
8941
9192
  s(() => {
8942
9193
  if (!e) return;
8943
9194
  let n = setInterval(() => {
@@ -8973,13 +9224,13 @@ function us({ running: e, every: t, slide: n, step: r, index: i, total: a, home:
8973
9224
  l
8974
9225
  ]), null;
8975
9226
  }
8976
- var ds = {
9227
+ var hs = {
8977
9228
  tablet: 991,
8978
9229
  mobileLandscape: 767,
8979
9230
  mobile: 478
8980
- }, fs = "M4 6h16M4 12h16M4 18h16", ps = (e) => e && Zi[e] ? Zi[e] : fs;
8981
- function ms({ 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 }) {
8982
- let [O, k] = d(!1), A = `wb-drw-${c().replace(/[^\w-]/g, "")}`, j = u(null), M = t === "always" ? "" : `(max-width: ${ds[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);
9231
+ }, gs = "M4 6h16M4 12h16M4 18h16", _s = (e) => e && Zi[e] ? Zi[e] : gs;
9232
+ function vs({ 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 }) {
9233
+ let [O, k] = d(!1), A = `wb-drw-${c().replace(/[^\w-]/g, "")}`, j = u(null), M = t === "always" ? "" : `(max-width: ${hs[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);
8983
9234
  s(() => {
8984
9235
  if (D) {
8985
9236
  I(null), k(!1);
@@ -9136,11 +9387,12 @@ function ms({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", widt
9136
9387
  className: "wb-drw-head",
9137
9388
  style: {
9138
9389
  alignItems: "center",
9390
+ justifyContent: f ? void 0 : "flex-end",
9139
9391
  gap: 12,
9140
9392
  padding: "14px 16px",
9141
9393
  ...W ? { display: "flex" } : null
9142
9394
  },
9143
- children: [/* @__PURE__ */ h("span", {
9395
+ children: [f && /* @__PURE__ */ h("span", {
9144
9396
  ...Q("title"),
9145
9397
  style: {
9146
9398
  flexGrow: 1,
@@ -9214,7 +9466,7 @@ function ms({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", widt
9214
9466
  strokeLinecap: "round",
9215
9467
  strokeLinejoin: "round",
9216
9468
  "aria-hidden": "true",
9217
- children: /* @__PURE__ */ h("path", { d: ps(l) })
9469
+ children: /* @__PURE__ */ h("path", { d: _s(l) })
9218
9470
  }), o ? /* @__PURE__ */ h("span", { children: o }) : null]
9219
9471
  }),
9220
9472
  W && i !== "button" && !G && /* @__PURE__ */ g("div", {
@@ -9259,8 +9511,8 @@ function ms({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", widt
9259
9511
  ]
9260
9512
  });
9261
9513
  }
9262
- function hs({ target: e = "", breakpoint: t = "tablet", label: n = "", icon: r = "", forceMode: i, style: a, nodeRef: o, inert: s = !1 }) {
9263
- let l = `wb-dbt-${c().replace(/[^\w-]/g, "")}`, u = ds[t], d = i || t === "always" || !u ? "" : `@media (min-width: ${u + 1}px) { .${l} { display: none !important; } }`, f = i === "inline";
9514
+ function ys({ target: e = "", breakpoint: t = "tablet", label: n = "", icon: r = "", forceMode: i, style: a, nodeRef: o, inert: s = !1 }) {
9515
+ let l = `wb-dbt-${c().replace(/[^\w-]/g, "")}`, u = hs[t], d = i || t === "always" || !u ? "" : `@media (min-width: ${u + 1}px) { .${l} { display: none !important; } }`, f = i === "inline";
9264
9516
  return /* @__PURE__ */ g(m, { children: [d ? /* @__PURE__ */ h("style", { children: d }) : null, /* @__PURE__ */ g("button", {
9265
9517
  ref: o,
9266
9518
  type: "button",
@@ -9294,20 +9546,20 @@ function hs({ target: e = "", breakpoint: t = "tablet", label: n = "", icon: r =
9294
9546
  strokeLinecap: "round",
9295
9547
  strokeLinejoin: "round",
9296
9548
  "aria-hidden": "true",
9297
- children: /* @__PURE__ */ h("path", { d: ps(r) })
9549
+ children: /* @__PURE__ */ h("path", { d: _s(r) })
9298
9550
  }), n ? /* @__PURE__ */ h("span", {
9299
9551
  ...Q("label"),
9300
9552
  children: n
9301
9553
  }) : null]
9302
9554
  })] });
9303
9555
  }
9304
- var gs = {
9556
+ var bs = {
9305
9557
  small: 380,
9306
9558
  medium: 560,
9307
9559
  large: 820,
9308
9560
  full: "100%"
9309
9561
  };
9310
- function _s({ 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 }) {
9562
+ function xs({ 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 }) {
9311
9563
  let [C, w] = d(!1), T = u(null);
9312
9564
  s(() => {
9313
9565
  S && w(!1);
@@ -9334,7 +9586,7 @@ function _s({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
9334
9586
  document.removeEventListener("keydown", e), document.body.style.overflow = t;
9335
9587
  };
9336
9588
  }, [S, C]);
9337
- let E = gs[a] ?? gs.medium, D = (e) => {
9589
+ let E = bs[a] ?? bs.medium, D = (e) => {
9338
9590
  let t = e.variant ?? "primary", n = {
9339
9591
  padding: "9px 16px",
9340
9592
  borderRadius: 6,
@@ -9432,11 +9684,12 @@ function _s({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
9432
9684
  style: {
9433
9685
  display: "flex",
9434
9686
  alignItems: "center",
9687
+ justifyContent: o ? void 0 : "flex-end",
9435
9688
  gap: 12,
9436
9689
  padding: "16px 20px",
9437
9690
  borderBottom: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))"
9438
9691
  },
9439
- children: [/* @__PURE__ */ h("span", {
9692
+ children: [o && /* @__PURE__ */ h("span", {
9440
9693
  ...Q("title"),
9441
9694
  style: {
9442
9695
  fontWeight: 700,
@@ -9512,7 +9765,7 @@ function _s({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
9512
9765
  })]
9513
9766
  });
9514
9767
  }
9515
- function vs({ 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 }) {
9768
+ function Ss({ 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 }) {
9516
9769
  let [_, v] = d(!1);
9517
9770
  s(() => {
9518
9771
  m && v(!1);
@@ -9619,15 +9872,15 @@ function vs({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu
9619
9872
  }), E]
9620
9873
  });
9621
9874
  }
9622
- var ys = {
9875
+ var Cs = {
9623
9876
  PageRoot: Vr,
9624
9877
  MarkdownBlock: oi,
9625
- CalendarBlock: os,
9626
- LogoCarousel: ls,
9627
- DialogBlock: _s,
9628
- DrawerBlock: ms,
9629
- DrawerTrigger: hs,
9630
- DropdownBlock: vs,
9878
+ CalendarBlock: us,
9879
+ LogoCarousel: ps,
9880
+ DialogBlock: xs,
9881
+ DrawerBlock: vs,
9882
+ DrawerTrigger: ys,
9883
+ DropdownBlock: Ss,
9631
9884
  Section: Hr,
9632
9885
  Container: Ur,
9633
9886
  LinkBlock: Wr,
@@ -9648,13 +9901,15 @@ var ys = {
9648
9901
  SectionIndexBlock: $a,
9649
9902
  SlideTextBlock: Qa,
9650
9903
  PaginationBlock: eo,
9651
- StepperBlock: vo,
9652
- SocialLinksBlock: _o,
9904
+ StepperBlock: So,
9905
+ SocialLinksBlock: xo,
9653
9906
  ThemeModeBlock: ao,
9654
- ScrollTopBlock: ho,
9907
+ ScrollTopBlock: yo,
9908
+ CustomCursorBlock: vo,
9909
+ TypewriterBlock: go,
9655
9910
  CounterBlock: mo,
9656
- OrgChartBlock: Lo,
9657
- TableBlock: Qo,
9911
+ OrgChartBlock: Vo,
9912
+ TableBlock: ns,
9658
9913
  IconBlock: Qi,
9659
9914
  MapBlock: Xi,
9660
9915
  MasonryBlock: ea,
@@ -9689,15 +9944,15 @@ var ys = {
9689
9944
  FormFile: Ha,
9690
9945
  FormRecaptcha: Fa,
9691
9946
  FormSubmit: Wa
9692
- }, bs = {
9947
+ }, ws = {
9693
9948
  id: "access",
9694
9949
  label: "Accessibility toolbar",
9695
9950
  category: "Apps",
9696
9951
  keys: ["AccessibilityToolbar"],
9697
9952
  ssr: "shell",
9698
9953
  settings: []
9699
- }, xs = /^[A-Za-z0-9_-]{4,64}$/;
9700
- function Ss(e) {
9954
+ }, Ts = /^[A-Za-z0-9_-]{4,64}$/;
9955
+ function Es(e) {
9701
9956
  try {
9702
9957
  let t = new URL(String(e || "").trim());
9703
9958
  return t.protocol === "https:" || t.protocol === "http:" ? t.origin : "";
@@ -9705,10 +9960,10 @@ function Ss(e) {
9705
9960
  return "";
9706
9961
  }
9707
9962
  }
9708
- var Cs = (e) => xs.test(String(e || "").trim());
9709
- function ws({ server: e, siteKey: t, inert: n }) {
9710
- let r = Ss(e), i = String(t || "").trim(), a = typeof window < "u" && !!window.__WEBIM_DASHBOARD__;
9711
- return n || a || !r || !Cs(i) ? null : /* @__PURE__ */ h("script", {
9963
+ var Ds = (e) => Ts.test(String(e || "").trim());
9964
+ function Os({ server: e, siteKey: t, inert: n }) {
9965
+ let r = Es(e), i = String(t || "").trim(), a = typeof window < "u" && !!window.__WEBIM_DASHBOARD__;
9966
+ return n || a || !r || !Ds(i) ? null : /* @__PURE__ */ h("script", {
9712
9967
  async: !0,
9713
9968
  src: `${r}/widget.js`,
9714
9969
  "data-site": i
@@ -9716,39 +9971,39 @@ function ws({ server: e, siteKey: t, inert: n }) {
9716
9971
  }
9717
9972
  //#endregion
9718
9973
  //#region ../ui/src/components/builder/apps/auth/manifest.js
9719
- var Ts = {
9974
+ var ks = {
9720
9975
  id: "auth",
9721
9976
  label: "Accounts",
9722
9977
  category: "Apps",
9723
9978
  keys: ["SiteLoginForm", "SiteAccountMenu"],
9724
9979
  ssr: "shell",
9725
9980
  settings: ["site.authRedirect"]
9726
- }, Es = n({
9981
+ }, As = n({
9727
9982
  user: null,
9728
9983
  status: "idle",
9729
9984
  ensure: () => {},
9730
9985
  refresh: () => {},
9731
9986
  signOut: () => {}
9732
9987
  });
9733
- function Ds(e, t) {
9988
+ function js(e, t) {
9734
9989
  return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
9735
9990
  }
9736
- function Os(e) {
9991
+ function Ms(e) {
9737
9992
  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);
9738
9993
  return {
9739
9994
  mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
9740
9995
  url: i,
9741
9996
  mePath: a,
9742
9997
  logoutPath: o,
9743
- meUrl: Ds(i, a),
9744
- logoutUrl: Ds(i, o),
9998
+ meUrl: js(i, a),
9999
+ logoutUrl: js(i, o),
9745
10000
  loginPage: r(n.loginPage),
9746
10001
  userPath: r(n.userPath),
9747
10002
  auth: n.auth === "bearer" ? "bearer" : "cookies",
9748
10003
  tokenKey: r(n.tokenKey) || "webim_session_token"
9749
10004
  };
9750
10005
  }
9751
- function ks(e, t) {
10006
+ function Ns(e, t) {
9752
10007
  if (!t) return e ?? null;
9753
10008
  let n = e;
9754
10009
  for (let e of t.split(".")) {
@@ -9757,26 +10012,26 @@ function ks(e, t) {
9757
10012
  }
9758
10013
  return n ?? null;
9759
10014
  }
9760
- function As(e) {
10015
+ function Ps(e) {
9761
10016
  try {
9762
10017
  return window.localStorage.getItem(e) || "";
9763
10018
  } catch {
9764
10019
  return "";
9765
10020
  }
9766
10021
  }
9767
- function js(e) {
10022
+ function Fs(e) {
9768
10023
  try {
9769
10024
  window.localStorage.removeItem(e);
9770
10025
  } catch {}
9771
10026
  }
9772
- var Ms = () => {
9773
- let e = o(Es);
10027
+ var Is = () => {
10028
+ let e = o(As);
9774
10029
  return s(() => {
9775
10030
  e.ensure();
9776
10031
  }, [e]), e;
9777
10032
  };
9778
- function Ns({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i }) {
9779
- let c = o(Z), f = r || c?.apiUrl || "/api", p = i || c?.tenant || "", m = l(() => Os(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}`, {
10033
+ function Ls({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i }) {
10034
+ let c = o(Z), f = r || c?.apiUrl || "/api", p = i || c?.tenant || "", m = l(() => Ms(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}`, {
9780
10035
  ...t,
9781
10036
  credentials: "include",
9782
10037
  headers: {
@@ -9788,9 +10043,9 @@ function Ns({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
9788
10043
  if (n) return Promise.resolve(null);
9789
10044
  if (m.mode === "off") return Promise.resolve(S(null));
9790
10045
  if (m.mode === "custom") {
9791
- let e = m.auth === "bearer" ? As(m.tokenKey) : "";
10046
+ let e = m.auth === "bearer" ? Ps(m.tokenKey) : "";
9792
10047
  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) => {
9793
- let t = ks(e, m.userPath);
10048
+ let t = Ns(e, m.userPath);
9794
10049
  return S(t && typeof t == "object" ? t : null);
9795
10050
  }).catch(() => S(null));
9796
10051
  }
@@ -9803,12 +10058,12 @@ function Ns({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
9803
10058
  ]), w = a(() => {
9804
10059
  if (m.mode === "off") return S(null), Promise.resolve();
9805
10060
  if (m.mode === "custom") {
9806
- let e = m.auth === "bearer" ? As(m.tokenKey) : "";
10061
+ let e = m.auth === "bearer" ? Ps(m.tokenKey) : "";
9807
10062
  return (m.logoutUrl ? fetch(m.logoutUrl, {
9808
10063
  method: "post",
9809
10064
  ...m.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
9810
10065
  }).catch(() => {}) : Promise.resolve()).then(() => {
9811
- m.auth === "bearer" && js(m.tokenKey), S(null);
10066
+ m.auth === "bearer" && Fs(m.tokenKey), S(null);
9812
10067
  });
9813
10068
  }
9814
10069
  return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
@@ -9858,18 +10113,18 @@ function Ns({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
9858
10113
  m.loginPage,
9859
10114
  C,
9860
10115
  w
9861
- ]), /* @__PURE__ */ h(Es.Provider, {
10116
+ ]), /* @__PURE__ */ h(As.Provider, {
9862
10117
  value: E,
9863
10118
  children: e
9864
10119
  });
9865
10120
  }
9866
- function Ps({ when: e, children: t }) {
9867
- let { status: n } = Ms();
10121
+ function Rs({ when: e, children: t }) {
10122
+ let { status: n } = Is();
9868
10123
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
9869
10124
  }
9870
10125
  //#endregion
9871
10126
  //#region ../ui/src/components/builder/apps/auth/views.jsx
9872
- function Fs({ 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 }) {
10127
+ function zs({ 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 }) {
9873
10128
  let { tenant: p, apiUrl: m, settings: _ } = o(Z), [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) => {
9874
10129
  if (e.preventDefault(), l) return;
9875
10130
  let n = new FormData(e.currentTarget);
@@ -10002,8 +10257,8 @@ function Fs({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
10002
10257
  ]
10003
10258
  });
10004
10259
  }
10005
- function Is({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
10006
- let { user: c, status: l, signOut: u } = Ms(), d = a ? s || "user" : l, f = a ? {
10260
+ function Bs({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
10261
+ let { user: c, status: l, signOut: u } = Is(), d = a ? s || "user" : l, f = a ? {
10007
10262
  name: "Ada Lovelace",
10008
10263
  email: "ada@example.com"
10009
10264
  } : c;
@@ -10071,40 +10326,40 @@ function Is({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
10071
10326
  }
10072
10327
  //#endregion
10073
10328
  //#region ../ui/src/components/builder/apps/consent/manifest.js
10074
- var Ls = {
10329
+ var Vs = {
10075
10330
  id: "consent",
10076
10331
  label: "Cookie consent",
10077
10332
  category: "Apps",
10078
10333
  keys: ["CookieConsent"],
10079
10334
  ssr: "shell",
10080
10335
  settings: []
10081
- }, Rs = "webim.cookie_consent";
10082
- function zs() {
10336
+ }, Hs = "webim.cookie_consent";
10337
+ function Us() {
10083
10338
  try {
10084
- let e = window.localStorage.getItem(Rs), t = e ? JSON.parse(e) : null;
10339
+ let e = window.localStorage.getItem(Hs), t = e ? JSON.parse(e) : null;
10085
10340
  return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
10086
10341
  } catch {
10087
10342
  return "";
10088
10343
  }
10089
10344
  }
10090
- function Bs(e) {
10345
+ function Ws(e) {
10091
10346
  try {
10092
10347
  document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
10093
10348
  } catch {}
10094
10349
  }
10095
- function Vs(e) {
10350
+ function Gs(e) {
10096
10351
  try {
10097
- window.localStorage.setItem(Rs, JSON.stringify({
10352
+ window.localStorage.setItem(Hs, JSON.stringify({
10098
10353
  choice: e,
10099
10354
  at: (/* @__PURE__ */ new Date()).toISOString()
10100
10355
  }));
10101
10356
  } catch {}
10102
- Bs(e);
10357
+ Ws(e);
10103
10358
  try {
10104
10359
  window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
10105
10360
  } catch {}
10106
10361
  }
10107
- var Hs = {
10362
+ var Ks = {
10108
10363
  bottom: {
10109
10364
  left: 0,
10110
10365
  right: 0,
@@ -10126,18 +10381,18 @@ var Hs = {
10126
10381
  maxWidth: 400
10127
10382
  }
10128
10383
  };
10129
- function Us({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: a, position: o, linked: c, style: l, nodeRef: u, inert: f }) {
10384
+ function qs({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: a, position: o, linked: c, style: l, nodeRef: u, inert: f }) {
10130
10385
  let [p, _] = d(!!f), [v, y] = d(null), b = (e) => {
10131
10386
  y(e), typeof u == "function" && u(e);
10132
10387
  };
10133
10388
  if (s(() => {
10134
10389
  if (f) return;
10135
- let e = zs();
10136
- e ? Bs(e) : _(!0);
10390
+ let e = Us();
10391
+ e ? Ws(e) : _(!0);
10137
10392
  }, [f, v]), !p) return null;
10138
10393
  let x = (e) => () => {
10139
- f || (Vs(e), _(!1));
10140
- }, S = Hs[o] ?? Hs.bottom, C = {
10394
+ f || (Gs(e), _(!1));
10395
+ }, S = Ks[o] ?? Ks.bottom, C = {
10141
10396
  appearance: "none",
10142
10397
  font: "inherit",
10143
10398
  fontSize: 14,
@@ -10222,37 +10477,37 @@ function Us({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
10222
10477
  }
10223
10478
  //#endregion
10224
10479
  //#region ../ui/src/components/builder/apps/language/manifest.js
10225
- var Ws = {
10480
+ var Js = {
10226
10481
  id: "language",
10227
10482
  label: "Language",
10228
10483
  category: "Apps",
10229
10484
  keys: ["SiteLanguagePicker"],
10230
10485
  ssr: "prefetch",
10231
10486
  settings: ["locales"]
10232
- }, Gs = {
10487
+ }, Ys = {
10233
10488
  id: "search",
10234
10489
  label: "Search",
10235
10490
  category: "Apps",
10236
10491
  keys: ["SiteSearch"],
10237
10492
  ssr: "prefetch",
10238
10493
  settings: []
10239
- }, Ks = 50, qs = 2e3;
10240
- function Js() {
10494
+ }, Xs = 50, Zs = 2e3;
10495
+ function Qs() {
10241
10496
  return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
10242
10497
  }
10243
- function Ys(e, t) {
10498
+ function $s(e, t) {
10244
10499
  let n = e?.data ?? {}, r = [];
10245
10500
  for (let e of Object.values(n)) {
10246
10501
  let t = e == null ? "" : br(e);
10247
- if (t && r.push(t), r.join(" ").length > qs) break;
10502
+ if (t && r.push(t), r.join(" ").length > Zs) break;
10248
10503
  }
10249
- return r.join(" ").slice(0, qs).toLocaleLowerCase(t || void 0);
10504
+ return r.join(" ").slice(0, Zs).toLocaleLowerCase(t || void 0);
10250
10505
  }
10251
- function Xs({ 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 }) {
10252
- let { tenant: x, apiUrl: S, locale: C } = o(Z), [w, T] = d(() => Js()), [E, D] = d(() => Js()), [O, k] = d(null), [A, j] = d(!1), M = u(null), N = a === "popup";
10506
+ function ec({ 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 }) {
10507
+ let { tenant: x, apiUrl: S, locale: C } = o(Z), [w, T] = d(() => Qs()), [E, D] = d(() => Qs()), [O, k] = d(null), [A, j] = d(!1), M = u(null), N = a === "popup";
10253
10508
  s(() => {
10254
10509
  let e = () => {
10255
- let e = Js();
10510
+ let e = Qs();
10256
10511
  T(e), D(e);
10257
10512
  };
10258
10513
  return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
@@ -10303,7 +10558,7 @@ function Xs({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
10303
10558
  });
10304
10559
  }
10305
10560
  else for (let t of e.rows) {
10306
- if (!Ys(t, C).includes(P)) continue;
10561
+ if (!$s(t, C).includes(P)) continue;
10307
10562
  let n = t?.data ?? {}, r = br(n.name) || "Untitled", i = br(n.slug);
10308
10563
  F.push({
10309
10564
  key: `entry:${t.id}`,
@@ -10312,7 +10567,7 @@ function Xs({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
10312
10567
  kind: "entry"
10313
10568
  });
10314
10569
  }
10315
- let I = F.slice(0, Math.min(Math.max(1, f), Ks)), L = (e) => {
10570
+ let I = F.slice(0, Math.min(Math.max(1, f), Xs)), L = (e) => {
10316
10571
  if (y) {
10317
10572
  e.preventDefault(), T(E), j(!0);
10318
10573
  return;
@@ -10465,7 +10720,7 @@ function Xs({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
10465
10720
  }
10466
10721
  //#endregion
10467
10722
  //#region ../ui/src/components/builder/apps/shop/manifest.js
10468
- var Zs = {
10723
+ var tc = {
10469
10724
  id: "shop",
10470
10725
  label: "Shop",
10471
10726
  category: "Shop",
@@ -10480,7 +10735,7 @@ var Zs = {
10480
10735
  ],
10481
10736
  ssr: "shell",
10482
10737
  settings: ["shop.enabled"]
10483
- }, Qs = "webim.cart.", $s = "webim.currency.", ec = /* @__PURE__ */ new Map(), tc = {
10738
+ }, nc = "webim.cart.", rc = "webim.currency.", ic = /* @__PURE__ */ new Map(), ac = {
10484
10739
  get(e) {
10485
10740
  try {
10486
10741
  return window.localStorage.getItem(e) ?? "";
@@ -10494,7 +10749,7 @@ var Zs = {
10494
10749
  } catch {}
10495
10750
  }
10496
10751
  };
10497
- function nc(e) {
10752
+ function oc(e) {
10498
10753
  if (typeof window > "u") return !1;
10499
10754
  try {
10500
10755
  return new URL(e, window.location.href).origin === window.location.origin;
@@ -10502,10 +10757,10 @@ function nc(e) {
10502
10757
  return !1;
10503
10758
  }
10504
10759
  }
10505
- async function rc(e, t, n, { method: r = "GET", body: i } = {}) {
10760
+ async function sc(e, t, n, { method: r = "GET", body: i } = {}) {
10506
10761
  let a = await fetch(`${e}${n}`, {
10507
10762
  method: r,
10508
- ...nc(e) ? { credentials: "include" } : {},
10763
+ ...oc(e) ? { credentials: "include" } : {},
10509
10764
  headers: {
10510
10765
  ...t ? { "x-tenant": t } : {},
10511
10766
  ...i ? { "content-type": "application/json" } : {}
@@ -10521,7 +10776,7 @@ async function rc(e, t, n, { method: r = "GET", body: i } = {}) {
10521
10776
  }
10522
10777
  return o.payload;
10523
10778
  }
10524
- var ic = {
10779
+ var cc = {
10525
10780
  id: "",
10526
10781
  currency: "",
10527
10782
  lines: [],
@@ -10536,29 +10791,29 @@ var ic = {
10536
10791
  shipping_total: 0,
10537
10792
  total: 0
10538
10793
  };
10539
- function ac(e, t) {
10540
- let n = `${Qs}${t || "default"}`, r = `${$s}${t || "default"}`, i = /* @__PURE__ */ new Set(), a = {
10541
- cart: ic,
10794
+ function lc(e, t) {
10795
+ let n = `${nc}${t || "default"}`, r = `${rc}${t || "default"}`, i = /* @__PURE__ */ new Set(), a = {
10796
+ cart: cc,
10542
10797
  loading: !1,
10543
10798
  loaded: !1,
10544
10799
  error: null,
10545
- currency: tc.get(r)
10800
+ currency: ac.get(r)
10546
10801
  }, o = null, s = () => i.forEach((e) => e()), c = (e) => {
10547
10802
  a = {
10548
10803
  ...a,
10549
10804
  ...e
10550
10805
  }, s();
10551
- }, l = (e) => (e && typeof e == "object" && (e.id && tc.set(n, e.id), c({
10806
+ }, l = (e) => (e && typeof e == "object" && (e.id && ac.set(n, e.id), c({
10552
10807
  cart: e,
10553
10808
  loaded: !0,
10554
10809
  error: null
10555
10810
  })), e), u = () => {
10556
10811
  if (o) return o;
10557
- let r = tc.get(n), i = new URLSearchParams({
10812
+ let r = ac.get(n), i = new URLSearchParams({
10558
10813
  ...r ? { id: r } : {},
10559
10814
  ...a.currency ? { currency: a.currency } : {}
10560
10815
  }).toString();
10561
- return c({ loading: !0 }), o = rc(e, t, `/store/cart${i ? `?${i}` : ""}`).then(l).catch((e) => c({
10816
+ return c({ loading: !0 }), o = sc(e, t, `/store/cart${i ? `?${i}` : ""}`).then(l).catch((e) => c({
10562
10817
  error: e,
10563
10818
  loaded: !0
10564
10819
  })).finally(() => {
@@ -10567,10 +10822,10 @@ function ac(e, t) {
10567
10822
  }, d = async (r, i, o) => {
10568
10823
  c({ loading: !0 });
10569
10824
  try {
10570
- return l(await rc(e, t, "/store/cart", {
10825
+ return l(await sc(e, t, "/store/cart", {
10571
10826
  method: "POST",
10572
10827
  body: {
10573
- cart_id: tc.get(n) || void 0,
10828
+ cart_id: ac.get(n) || void 0,
10574
10829
  product_id: r,
10575
10830
  variant_id: i ?? null,
10576
10831
  quantity: o,
@@ -10582,7 +10837,7 @@ function ac(e, t) {
10582
10837
  }
10583
10838
  };
10584
10839
  return typeof window < "u" && window.addEventListener("storage", (e) => {
10585
- e.key === r && c({ currency: tc.get(r) }), (e.key === n || e.key === r) && u();
10840
+ e.key === r && c({ currency: ac.get(r) }), (e.key === n || e.key === r) && u();
10586
10841
  }), {
10587
10842
  getState: () => a,
10588
10843
  subscribe: (e) => (i.add(e), () => i.delete(e)),
@@ -10595,10 +10850,10 @@ function ac(e, t) {
10595
10850
  setCoupon: async (r) => {
10596
10851
  c({ loading: !0 });
10597
10852
  try {
10598
- return l(await rc(e, t, "/store/cart/coupon", {
10853
+ return l(await sc(e, t, "/store/cart/coupon", {
10599
10854
  method: "POST",
10600
10855
  body: {
10601
- cart_id: tc.get(n),
10856
+ cart_id: ac.get(n),
10602
10857
  code: r
10603
10858
  }
10604
10859
  }));
@@ -10606,64 +10861,64 @@ function ac(e, t) {
10606
10861
  c({ loading: !1 });
10607
10862
  }
10608
10863
  },
10609
- setCountry: async (r, i) => tc.get(n) ? l(await rc(e, t, "/store/cart/country", {
10864
+ setCountry: async (r, i) => ac.get(n) ? l(await sc(e, t, "/store/cart/country", {
10610
10865
  method: "POST",
10611
10866
  body: {
10612
- cart_id: tc.get(n),
10867
+ cart_id: ac.get(n),
10613
10868
  country: r,
10614
10869
  ...i !== void 0 && { postal_code: i }
10615
10870
  }
10616
10871
  })) : a.cart,
10617
- setDelivery: async (r) => tc.get(n) ? l(await rc(e, t, "/store/cart/delivery", {
10872
+ setDelivery: async (r) => ac.get(n) ? l(await sc(e, t, "/store/cart/delivery", {
10618
10873
  method: "POST",
10619
10874
  body: {
10620
- cart_id: tc.get(n),
10875
+ cart_id: ac.get(n),
10621
10876
  delivery: r
10622
10877
  }
10623
10878
  })) : a.cart,
10624
10879
  setCurrency: async (i) => {
10625
- if (tc.set(r, i), c({ currency: i }), !tc.get(n)) return u();
10880
+ if (ac.set(r, i), c({ currency: i }), !ac.get(n)) return u();
10626
10881
  try {
10627
- return l(await rc(e, t, "/store/cart/currency", {
10882
+ return l(await sc(e, t, "/store/cart/currency", {
10628
10883
  method: "POST",
10629
10884
  body: {
10630
- cart_id: tc.get(n),
10885
+ cart_id: ac.get(n),
10631
10886
  currency: i
10632
10887
  }
10633
10888
  }));
10634
10889
  } catch {
10635
- return tc.set(r, ""), c({ currency: "" }), u();
10890
+ return ac.set(r, ""), c({ currency: "" }), u();
10636
10891
  }
10637
10892
  },
10638
10893
  reset: () => {
10639
- tc.set(n, ""), c({ cart: ic });
10894
+ ac.set(n, ""), c({ cart: cc });
10640
10895
  },
10641
- cartId: () => tc.get(n)
10896
+ cartId: () => ac.get(n)
10642
10897
  };
10643
10898
  }
10644
- function oc(e, t) {
10899
+ function uc(e, t) {
10645
10900
  let n = `${e}|${t}`;
10646
- return ec.has(n) || ec.set(n, ac(e, t)), ec.get(n);
10901
+ return ic.has(n) || ic.set(n, lc(e, t)), ic.get(n);
10647
10902
  }
10648
- function sc(e, t) {
10903
+ function dc(e, t) {
10649
10904
  let n = Array.isArray(e?.currencies) ? e.currencies : [];
10650
10905
  return t && n.includes(t) ? t : e?.currency || "";
10651
10906
  }
10652
- var cc = "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(" ");
10653
- function lc(e, t = [], n = null) {
10907
+ var fc = "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(" ");
10908
+ function pc(e, t = [], n = null) {
10654
10909
  let r;
10655
10910
  try {
10656
10911
  r = new Intl.DisplayNames([e || "en"], { type: "region" });
10657
10912
  } catch {
10658
10913
  r = { of: (e) => e };
10659
10914
  }
10660
- let i = (n ?? cc).map((e) => ({
10915
+ let i = (n ?? fc).map((e) => ({
10661
10916
  code: e,
10662
10917
  name: r.of(e) ?? e
10663
10918
  })), 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));
10664
10919
  return [...a, ...o];
10665
10920
  }
10666
- function uc(e, t, n) {
10921
+ function mc(e, t, n) {
10667
10922
  let r = t || "USD";
10668
10923
  try {
10669
10924
  let t = new Intl.NumberFormat(n || void 0, {
@@ -10675,7 +10930,7 @@ function uc(e, t, n) {
10675
10930
  return `${(Number(e || 0) / 100).toFixed(2)} ${r}`;
10676
10931
  }
10677
10932
  }
10678
- var dc = {
10933
+ var hc = {
10679
10934
  en: {
10680
10935
  add: "Add to cart",
10681
10936
  adding: "Adding…",
@@ -11007,24 +11262,24 @@ var dc = {
11007
11262
  no: "Hayır"
11008
11263
  }
11009
11264
  };
11010
- function fc(e) {
11011
- let t = dc[String(e || "").toLowerCase().split("-")[0]] ?? dc.en, n = (e, n) => {
11012
- let r = t[e] ?? dc.en[e] ?? e;
11265
+ function gc(e) {
11266
+ let t = hc[String(e || "").toLowerCase().split("-")[0]] ?? hc.en, n = (e, n) => {
11267
+ let r = t[e] ?? hc.en[e] ?? e;
11013
11268
  return n ? r.replace(/\{(\w+)\}/g, (e, t) => t in n ? String(n[t]) : e) : r;
11014
11269
  };
11015
- return n.has = (e) => e in dc.en, n;
11270
+ return n.has = (e) => e in hc.en, n;
11016
11271
  }
11017
- var pc = (e, t) => t?.code && e.has(t.code) ? e(t.code) : t?.message ?? "", mc = /* @__PURE__ */ new Map();
11018
- function hc(e, t) {
11272
+ var _c = (e, t) => t?.code && e.has(t.code) ? e(t.code) : t?.message ?? "", vc = /* @__PURE__ */ new Map();
11273
+ function yc(e, t) {
11019
11274
  let n = `${e}|${t}`;
11020
- return mc.has(n) || mc.set(n, rc(e, t, "/store/policies").then((e) => Array.isArray(e) ? e : []).catch(() => (mc.delete(n), []))), mc.get(n);
11275
+ return vc.has(n) || vc.set(n, sc(e, t, "/store/policies").then((e) => Array.isArray(e) ? e : []).catch(() => (vc.delete(n), []))), vc.get(n);
11021
11276
  }
11022
- function gc(e) {
11277
+ function bc(e) {
11023
11278
  let t = /* @__PURE__ */ new Date(), n = Math.max(0, Math.round(Number(e) || 0));
11024
11279
  for (; n > 0;) t.setDate(t.getDate() + 1), t.getDay() !== 0 && t.getDay() !== 6 && --n;
11025
11280
  return t;
11026
11281
  }
11027
- function _c(e, t, n, r) {
11282
+ function xc(e, t, n, r) {
11028
11283
  let i = (e) => e != null && Number.isFinite(Number(e));
11029
11284
  if (!i(n) && !i(r)) return "";
11030
11285
  let a;
@@ -11039,7 +11294,7 @@ function _c(e, t, n, r) {
11039
11294
  day: "numeric"
11040
11295
  });
11041
11296
  }
11042
- let o = a.format(gc(i(n) ? n : r)), s = a.format(gc(i(r) ? r : n));
11297
+ let o = a.format(bc(i(n) ? n : r)), s = a.format(bc(i(r) ? r : n));
11043
11298
  return o === s ? e("arrives", { date: o }) : e("arrivesRange", {
11044
11299
  from: o,
11045
11300
  to: s
@@ -11047,7 +11302,7 @@ function _c(e, t, n, r) {
11047
11302
  }
11048
11303
  //#endregion
11049
11304
  //#region ../ui/src/components/builder/apps/shop/engagement.jsx
11050
- var vc = "var(--page-muted, rgba(100,116,139,1))", yc = "1px solid var(--page-border, #d1d5db)", bc = "var(--page-surface, #f2f2f2)", xc = "#f59e0b", Sc = {
11305
+ var Sc = "var(--page-muted, rgba(100,116,139,1))", Cc = "1px solid var(--page-border, #d1d5db)", wc = "var(--page-surface, #f2f2f2)", Tc = "#f59e0b", Ec = {
11051
11306
  ...Ir,
11052
11307
  border: 0,
11053
11308
  borderRadius: "8px",
@@ -11055,14 +11310,14 @@ var vc = "var(--page-muted, rgba(100,116,139,1))", yc = "1px solid var(--page-bo
11055
11310
  fontSize: "14px",
11056
11311
  fontWeight: 600,
11057
11312
  fontFamily: "inherit"
11058
- }, Cc = {
11059
- ...Sc,
11313
+ }, Dc = {
11314
+ ...Ec,
11060
11315
  backgroundColor: "transparent",
11061
11316
  color: "var(--page-text, #111827)",
11062
- border: yc
11317
+ border: Cc
11063
11318
  };
11064
- function wc() {
11065
- let { tenant: e, apiUrl: t, locale: n, settings: r } = o(Z), i = l(() => fc(n), [n]), a = (e) => r?.[e] !== !1;
11319
+ function Oc() {
11320
+ let { tenant: e, apiUrl: t, locale: n, settings: r } = o(Z), i = l(() => gc(n), [n]), a = (e) => r?.[e] !== !1;
11066
11321
  return {
11067
11322
  tenant: e,
11068
11323
  apiUrl: t || "/api",
@@ -11073,12 +11328,12 @@ function wc() {
11073
11328
  favoritesOn: a("shop.favorites"),
11074
11329
  moderated: r?.["shop.reviewModeration"] !== "auto",
11075
11330
  loginHref: () => {
11076
- let e = Os(r).loginPage || "/login", t = typeof window > "u" ? "" : `${window.location.pathname}${window.location.search}`;
11331
+ let e = Ms(r).loginPage || "/login", t = typeof window > "u" ? "" : `${window.location.pathname}${window.location.search}`;
11077
11332
  return t ? `${e}${e.includes("?") ? "&" : "?"}next=${encodeURIComponent(t)}` : e;
11078
11333
  }
11079
11334
  };
11080
11335
  }
11081
- var Tc = (e, t) => {
11336
+ var kc = (e, t) => {
11082
11337
  try {
11083
11338
  return new Intl.NumberFormat(t || void 0, {
11084
11339
  notation: "compact",
@@ -11087,7 +11342,7 @@ var Tc = (e, t) => {
11087
11342
  } catch {
11088
11343
  return String(e);
11089
11344
  }
11090
- }, Ec = (e, t) => {
11345
+ }, Ac = (e, t) => {
11091
11346
  try {
11092
11347
  return new Intl.DateTimeFormat(t || void 0, {
11093
11348
  day: "numeric",
@@ -11097,8 +11352,8 @@ var Tc = (e, t) => {
11097
11352
  } catch {
11098
11353
  return String(e).slice(0, 10);
11099
11354
  }
11100
- }, Dc = "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";
11101
- function Oc({ fill: e = 0, size: t = 16, clipId: n }) {
11355
+ }, jc = "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";
11356
+ function Mc({ fill: e = 0, size: t = 16, clipId: n }) {
11102
11357
  return /* @__PURE__ */ g("svg", {
11103
11358
  width: t,
11104
11359
  height: t,
@@ -11116,18 +11371,18 @@ function Oc({ fill: e = 0, size: t = 16, clipId: n }) {
11116
11371
  })
11117
11372
  }) }),
11118
11373
  /* @__PURE__ */ h("path", {
11119
- d: Dc,
11374
+ d: jc,
11120
11375
  fill: "var(--page-border, #d1d5db)"
11121
11376
  }),
11122
11377
  e > 0 && /* @__PURE__ */ h("path", {
11123
- d: Dc,
11124
- fill: xc,
11378
+ d: jc,
11379
+ fill: Tc,
11125
11380
  clipPath: `url(#${n})`
11126
11381
  })
11127
11382
  ]
11128
11383
  });
11129
11384
  }
11130
- function kc({ value: e = 0, size: t = 16 }) {
11385
+ function Nc({ value: e = 0, size: t = 16 }) {
11131
11386
  let n = c().replace(/:/g, "");
11132
11387
  return /* @__PURE__ */ h("span", {
11133
11388
  role: "img",
@@ -11144,14 +11399,14 @@ function kc({ value: e = 0, size: t = 16 }) {
11144
11399
  2,
11145
11400
  3,
11146
11401
  4
11147
- ].map((r) => /* @__PURE__ */ h(Oc, {
11402
+ ].map((r) => /* @__PURE__ */ h(Mc, {
11148
11403
  fill: Math.max(0, Math.min(1, e - r)),
11149
11404
  size: t,
11150
11405
  clipId: `${n}-${r}`
11151
11406
  }, r))
11152
11407
  });
11153
11408
  }
11154
- function Ac({ value: e, onChange: t, size: n = 28, label: r }) {
11409
+ function Pc({ value: e, onChange: t, size: n = 28, label: r }) {
11155
11410
  let i = c().replace(/:/g, ""), [a, o] = d(0), s = a || e;
11156
11411
  return /* @__PURE__ */ h("span", {
11157
11412
  role: "radiogroup",
@@ -11182,7 +11437,7 @@ function Ac({ value: e, onChange: t, size: n = 28, label: r }) {
11182
11437
  cursor: "pointer",
11183
11438
  lineHeight: 0
11184
11439
  },
11185
- children: /* @__PURE__ */ h(Oc, {
11440
+ children: /* @__PURE__ */ h(Mc, {
11186
11441
  fill: +(s >= r),
11187
11442
  size: n,
11188
11443
  clipId: `${i}-${r}`
@@ -11190,15 +11445,15 @@ function Ac({ value: e, onChange: t, size: n = 28, label: r }) {
11190
11445
  }, r))
11191
11446
  });
11192
11447
  }
11193
- function jc(e, { inert: t }) {
11194
- let { tenant: n, apiUrl: r, favoritesOn: i } = wc(), [a, o] = d({
11448
+ function Fc(e, { inert: t }) {
11449
+ let { tenant: n, apiUrl: r, favoritesOn: i } = Oc(), [a, o] = d({
11195
11450
  favorited: !1,
11196
11451
  count: null
11197
11452
  });
11198
11453
  s(() => {
11199
11454
  if (!e || !i || t) return;
11200
11455
  let a = !0;
11201
- return rc(r, n, `/store/products/${encodeURIComponent(e)}/favorite`).then((e) => a && o(e)).catch(() => {}), () => {
11456
+ return sc(r, n, `/store/products/${encodeURIComponent(e)}/favorite`).then((e) => a && o(e)).catch(() => {}), () => {
11202
11457
  a = !1;
11203
11458
  };
11204
11459
  }, [
@@ -11215,7 +11470,7 @@ function jc(e, { inert: t }) {
11215
11470
  count: Math.max(0, (e.count ?? 0) + (t ? 1 : -1))
11216
11471
  }));
11217
11472
  try {
11218
- o(await rc(r, n, `/store/products/${encodeURIComponent(e)}/favorite`, {
11473
+ o(await sc(r, n, `/store/products/${encodeURIComponent(e)}/favorite`, {
11219
11474
  method: "POST",
11220
11475
  body: { on: t }
11221
11476
  }));
@@ -11231,7 +11486,7 @@ function jc(e, { inert: t }) {
11231
11486
  toggle: c
11232
11487
  };
11233
11488
  }
11234
- var Mc = (e) => /* @__PURE__ */ h("svg", {
11489
+ var Ic = (e) => /* @__PURE__ */ h("svg", {
11235
11490
  width: "20",
11236
11491
  height: "20",
11237
11492
  viewBox: "0 0 24 24",
@@ -11244,8 +11499,8 @@ var Mc = (e) => /* @__PURE__ */ h("svg", {
11244
11499
  strokeWidth: "1.8"
11245
11500
  })
11246
11501
  });
11247
- function Nc({ product: e, inert: t = !1, sample: n = !1 }) {
11248
- let { locale: r, words: i, reviewsOn: a, questionsOn: o, favoritesOn: s, loginHref: c } = wc(), l = e?.sample ? "" : e?.slug || e?.id || "", u = jc(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) => {
11502
+ function Lc({ product: e, inert: t = !1, sample: n = !1 }) {
11503
+ let { locale: r, words: i, reviewsOn: a, questionsOn: o, favoritesOn: s, loginHref: c } = Oc(), l = e?.sample ? "" : e?.slug || e?.id || "", u = Fc(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) => {
11249
11504
  n.preventDefault(), !t && document.getElementById(e)?.scrollIntoView({
11250
11505
  behavior: "smooth",
11251
11506
  block: "start"
@@ -11254,7 +11509,7 @@ function Nc({ product: e, inert: t = !1, sample: n = !1 }) {
11254
11509
  if (!(t || !l)) try {
11255
11510
  await u.toggle();
11256
11511
  } catch (e) {
11257
- e?.code === "LOGIN_REQUIRED" ? window.location.assign(c()) : p(pc(i, e));
11512
+ e?.code === "LOGIN_REQUIRED" ? window.location.assign(c()) : p(_c(i, e));
11258
11513
  }
11259
11514
  }, S = [];
11260
11515
  return a && m > 0 && S.push(/* @__PURE__ */ g("span", {
@@ -11272,13 +11527,13 @@ function Nc({ product: e, inert: t = !1, sample: n = !1 }) {
11272
11527
  maximumFractionDigits: 1
11273
11528
  })
11274
11529
  }),
11275
- /* @__PURE__ */ h(kc, { value: _ }),
11530
+ /* @__PURE__ */ h(Nc, { value: _ }),
11276
11531
  /* @__PURE__ */ h("a", {
11277
11532
  href: "#reviews",
11278
11533
  onClick: b("reviews"),
11279
11534
  ...Q("rating-link"),
11280
11535
  style: { color: "inherit" },
11281
- children: m === 1 ? i("reviewsOne") : i("reviewsCount", { n: Tc(m, r) })
11536
+ children: m === 1 ? i("reviewsOne") : i("reviewsCount", { n: kc(m, r) })
11282
11537
  })
11283
11538
  ]
11284
11539
  }, "r")), o && v > 0 && S.push(/* @__PURE__ */ h("a", {
@@ -11286,7 +11541,7 @@ function Nc({ product: e, inert: t = !1, sample: n = !1 }) {
11286
11541
  onClick: b("questions"),
11287
11542
  ...Q("qa-link"),
11288
11543
  style: { color: "inherit" },
11289
- children: i("qaCount", { n: Tc(v, r) })
11544
+ children: i("qaCount", { n: kc(v, r) })
11290
11545
  }, "q")), !S.length && !s ? null : /* @__PURE__ */ g("div", {
11291
11546
  ...Q("engagement"),
11292
11547
  style: {
@@ -11305,7 +11560,7 @@ function Nc({ product: e, inert: t = !1, sample: n = !1 }) {
11305
11560
  },
11306
11561
  children: S.flatMap((e, t) => t ? [/* @__PURE__ */ h("span", {
11307
11562
  ...Q("separator"),
11308
- style: { color: vc },
11563
+ style: { color: Sc },
11309
11564
  children: "•"
11310
11565
  }, `s${t}`), e] : [e])
11311
11566
  }),
@@ -11323,22 +11578,22 @@ function Nc({ product: e, inert: t = !1, sample: n = !1 }) {
11323
11578
  "aria-label": u.favorited ? i("unfavorite") : i("favorite"),
11324
11579
  title: u.favorited ? i("unfavorite") : i("favorite"),
11325
11580
  style: {
11326
- ...Cc,
11581
+ ...Dc,
11327
11582
  padding: "7px",
11328
11583
  borderRadius: "999px",
11329
11584
  lineHeight: 0
11330
11585
  },
11331
- children: Mc(u.favorited)
11586
+ children: Ic(u.favorited)
11332
11587
  }), y > 0 && /* @__PURE__ */ h("span", {
11333
11588
  ...Q("favorites-count"),
11334
11589
  style: { fontWeight: 600 },
11335
- children: y === 1 ? i("lovedByOne") : i("lovedBy", { n: Tc(y, r) })
11590
+ children: y === 1 ? i("lovedByOne") : i("lovedBy", { n: kc(y, r) })
11336
11591
  })]
11337
11592
  }),
11338
11593
  f && /* @__PURE__ */ h("span", {
11339
11594
  ...Q("note"),
11340
11595
  style: {
11341
- color: vc,
11596
+ color: Sc,
11342
11597
  fontSize: "13px"
11343
11598
  },
11344
11599
  children: f
@@ -11346,7 +11601,7 @@ function Nc({ product: e, inert: t = !1, sample: n = !1 }) {
11346
11601
  ]
11347
11602
  });
11348
11603
  }
11349
- var Pc = {
11604
+ var Rc = {
11350
11605
  data: [{
11351
11606
  id: "s1",
11352
11607
  author: "Ayşe Y.",
@@ -11382,8 +11637,8 @@ var Pc = {
11382
11637
  ]
11383
11638
  }
11384
11639
  };
11385
- function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11386
- let { tenant: r, apiUrl: i, locale: a, words: o, reviewsOn: c, moderated: l, loginHref: u } = wc(), f = Ms(), 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({
11640
+ function zc({ product: e, inert: t = !1, sample: n = !1 }) {
11641
+ let { tenant: r, apiUrl: i, locale: a, words: o, reviewsOn: c, moderated: l, loginHref: u } = Oc(), f = Is(), 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({
11387
11642
  rating: 0,
11388
11643
  title: "",
11389
11644
  body: ""
@@ -11391,7 +11646,7 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11391
11646
  if (s(() => {
11392
11647
  if (!c || !p) return;
11393
11648
  let e = !0, t = `?limit=${S}&sort=${v}${b ? `&rating=${b}` : ""}`;
11394
- return rc(i, r, `/store/products/${encodeURIComponent(p)}/reviews${t}`).then((t) => e && _(t)).catch(() => e && _({
11649
+ return sc(i, r, `/store/products/${encodeURIComponent(p)}/reviews${t}`).then((t) => e && _(t)).catch(() => e && _({
11395
11650
  data: [],
11396
11651
  total: {
11397
11652
  all: 0,
@@ -11421,7 +11676,7 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11421
11676
  w,
11422
11677
  c
11423
11678
  ]), !c) return null;
11424
- let P = n || !p ? Pc : m, F = P?.summary ?? {
11679
+ let P = n || !p ? Rc : m, F = P?.summary ?? {
11425
11680
  average: 0,
11426
11681
  count: 0,
11427
11682
  histogram: [
@@ -11454,12 +11709,12 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11454
11709
  }
11455
11710
  j(!0), N("");
11456
11711
  try {
11457
- await rc(i, r, `/store/products/${encodeURIComponent(p)}/reviews`, {
11712
+ await sc(i, r, `/store/products/${encodeURIComponent(p)}/reviews`, {
11458
11713
  method: "POST",
11459
11714
  body: E
11460
11715
  }), k(!1), N(o(l ? "reviewPending" : "reviewThanks")), T((e) => e + 1);
11461
11716
  } catch (e) {
11462
- e?.code === "LOGIN_REQUIRED" ? window.location.assign(u()) : N(pc(o, e));
11717
+ e?.code === "LOGIN_REQUIRED" ? window.location.assign(u()) : N(_c(o, e));
11463
11718
  } finally {
11464
11719
  j(!1);
11465
11720
  }
@@ -11511,14 +11766,14 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11511
11766
  maximumFractionDigits: 1
11512
11767
  }) : "–"
11513
11768
  }),
11514
- /* @__PURE__ */ h(kc, {
11769
+ /* @__PURE__ */ h(Nc, {
11515
11770
  value: F.average,
11516
11771
  size: 18
11517
11772
  }),
11518
11773
  /* @__PURE__ */ h("span", {
11519
11774
  ...Q("reviews-count"),
11520
11775
  style: {
11521
- color: vc,
11776
+ color: Sc,
11522
11777
  fontSize: "13px"
11523
11778
  },
11524
11779
  children: F.count === 1 ? o("reviewsOne") : o("reviewsCount", { n: F.count })
@@ -11570,7 +11825,7 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11570
11825
  style: {
11571
11826
  height: "8px",
11572
11827
  borderRadius: "4px",
11573
- background: bc,
11828
+ background: wc,
11574
11829
  overflow: "hidden"
11575
11830
  },
11576
11831
  children: /* @__PURE__ */ h("span", {
@@ -11579,13 +11834,13 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11579
11834
  display: "block",
11580
11835
  height: "100%",
11581
11836
  width: `${n / B * 100}%`,
11582
- background: xc
11837
+ background: Tc
11583
11838
  }
11584
11839
  })
11585
11840
  }),
11586
11841
  /* @__PURE__ */ h("span", {
11587
11842
  style: {
11588
- color: vc,
11843
+ color: Sc,
11589
11844
  textAlign: "right"
11590
11845
  },
11591
11846
  children: n
@@ -11600,7 +11855,7 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11600
11855
  type: "button",
11601
11856
  onClick: R,
11602
11857
  ...Q("review-button"),
11603
- style: Sc,
11858
+ style: Ec,
11604
11859
  children: o(L || t ? I ? "editReview" : "writeReview" : "signInToReview")
11605
11860
  })
11606
11861
  })
@@ -11614,7 +11869,7 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11614
11869
  flexDirection: "column",
11615
11870
  gap: "10px",
11616
11871
  padding: "16px",
11617
- border: yc,
11872
+ border: Cc,
11618
11873
  borderRadius: "12px"
11619
11874
  },
11620
11875
  children: [
@@ -11626,7 +11881,7 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11626
11881
  gap: "12px",
11627
11882
  fontWeight: 600
11628
11883
  },
11629
- children: [o("yourRating"), /* @__PURE__ */ h(Ac, {
11884
+ children: [o("yourRating"), /* @__PURE__ */ h(Pc, {
11630
11885
  value: E.rating,
11631
11886
  label: o("yourRating"),
11632
11887
  onChange: (e) => D((t) => ({
@@ -11671,13 +11926,13 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11671
11926
  type: "submit",
11672
11927
  disabled: A,
11673
11928
  ...Q("submit-button"),
11674
- style: Sc,
11929
+ style: Ec,
11675
11930
  children: o("submitReview")
11676
11931
  }), /* @__PURE__ */ h("button", {
11677
11932
  type: "button",
11678
11933
  onClick: () => k(!1),
11679
11934
  ...Q("cancel-button"),
11680
- style: Cc,
11935
+ style: Dc,
11681
11936
  children: "✕"
11682
11937
  })]
11683
11938
  })
@@ -11687,7 +11942,7 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11687
11942
  ...Q("note"),
11688
11943
  style: {
11689
11944
  margin: 0,
11690
- color: vc
11945
+ color: Sc
11691
11946
  },
11692
11947
  children: M
11693
11948
  }),
@@ -11731,7 +11986,7 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11731
11986
  onClick: () => x(0),
11732
11987
  ...Q("filter-chip"),
11733
11988
  style: {
11734
- ...Cc,
11989
+ ...Dc,
11735
11990
  padding: "6px 12px"
11736
11991
  },
11737
11992
  children: [o("starsN", { n: b }), " ✕"]
@@ -11741,7 +11996,7 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11741
11996
  ...Q("empty"),
11742
11997
  style: {
11743
11998
  margin: 0,
11744
- color: vc
11999
+ color: Sc
11745
12000
  },
11746
12001
  children: o("noReviews")
11747
12002
  }),
@@ -11754,7 +12009,7 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11754
12009
  ...Q("review"),
11755
12010
  style: {
11756
12011
  padding: "16px 0",
11757
- borderTop: yc,
12012
+ borderTop: Cc,
11758
12013
  display: "flex",
11759
12014
  flexDirection: "column",
11760
12015
  gap: "6px"
@@ -11768,7 +12023,7 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11768
12023
  flexWrap: "wrap"
11769
12024
  },
11770
12025
  children: [
11771
- /* @__PURE__ */ h(kc, { value: e.rating }),
12026
+ /* @__PURE__ */ h(Nc, { value: e.rating }),
11772
12027
  e.title && /* @__PURE__ */ h("strong", {
11773
12028
  ...Q("review-title"),
11774
12029
  children: e.title
@@ -11779,8 +12034,8 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11779
12034
  fontSize: "12px",
11780
12035
  padding: "2px 8px",
11781
12036
  borderRadius: "999px",
11782
- background: bc,
11783
- color: vc
12037
+ background: wc,
12038
+ color: Sc
11784
12039
  },
11785
12040
  children: o("awaitingApproval")
11786
12041
  })
@@ -11799,12 +12054,12 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11799
12054
  ...Q("meta"),
11800
12055
  style: {
11801
12056
  fontSize: "13px",
11802
- color: vc
12057
+ color: Sc
11803
12058
  },
11804
12059
  children: [
11805
12060
  e.author || o("anonymous"),
11806
12061
  " · ",
11807
- Ec(e.created_at, a),
12062
+ Ac(e.created_at, a),
11808
12063
  e.verified && /* @__PURE__ */ g("span", {
11809
12064
  ...Q("verified"),
11810
12065
  style: {
@@ -11821,7 +12076,7 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11821
12076
  marginTop: "4px",
11822
12077
  padding: "10px 12px",
11823
12078
  borderRadius: "8px",
11824
- background: bc,
12079
+ background: wc,
11825
12080
  fontSize: "14px"
11826
12081
  },
11827
12082
  children: [/* @__PURE__ */ h("strong", {
@@ -11829,7 +12084,7 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11829
12084
  style: {
11830
12085
  display: "block",
11831
12086
  fontSize: "12px",
11832
- color: vc,
12087
+ color: Sc,
11833
12088
  marginBottom: "2px"
11834
12089
  },
11835
12090
  children: o("shopReply")
@@ -11846,7 +12101,7 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11846
12101
  onClick: () => C((e) => e + 10),
11847
12102
  ...Q("load-more"),
11848
12103
  style: {
11849
- ...Cc,
12104
+ ...Dc,
11850
12105
  alignSelf: "center"
11851
12106
  },
11852
12107
  children: o("loadMore")
@@ -11854,7 +12109,7 @@ function Fc({ product: e, inert: t = !1, sample: n = !1 }) {
11854
12109
  ]
11855
12110
  });
11856
12111
  }
11857
- var Ic = {
12112
+ var Bc = {
11858
12113
  data: [{
11859
12114
  id: "q1",
11860
12115
  author: "Can D.",
@@ -11867,12 +12122,12 @@ var Ic = {
11867
12122
  filtered: 1
11868
12123
  }
11869
12124
  };
11870
- function Lc({ product: e, inert: t = !1, sample: n = !1 }) {
11871
- let { tenant: r, apiUrl: i, locale: a, words: o, questionsOn: c, loginHref: l } = wc(), u = Ms(), 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("");
12125
+ function Vc({ product: e, inert: t = !1, sample: n = !1 }) {
12126
+ let { tenant: r, apiUrl: i, locale: a, words: o, questionsOn: c, loginHref: l } = Oc(), u = Is(), 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("");
11872
12127
  if (s(() => {
11873
12128
  if (!c || !f) return;
11874
12129
  let e = !0;
11875
- return rc(i, r, `/store/products/${encodeURIComponent(f)}/questions?limit=${_}`).then((t) => e && m(t)).catch(() => e && m({
12130
+ return sc(i, r, `/store/products/${encodeURIComponent(f)}/questions?limit=${_}`).then((t) => e && m(t)).catch(() => e && m({
11876
12131
  data: [],
11877
12132
  total: {
11878
12133
  all: 0,
@@ -11889,7 +12144,7 @@ function Lc({ product: e, inert: t = !1, sample: n = !1 }) {
11889
12144
  y,
11890
12145
  c
11891
12146
  ]), !c) return null;
11892
- let D = n || !f ? Ic : p, O = u.status === "user", k = async (e) => {
12147
+ let D = n || !f ? Bc : p, O = u.status === "user", k = async (e) => {
11893
12148
  if (e.preventDefault(), !(t || x.trim().length < 3)) {
11894
12149
  if (!O) {
11895
12150
  window.location.assign(l());
@@ -11897,12 +12152,12 @@ function Lc({ product: e, inert: t = !1, sample: n = !1 }) {
11897
12152
  }
11898
12153
  w(!0), E("");
11899
12154
  try {
11900
- await rc(i, r, `/store/products/${encodeURIComponent(f)}/questions`, {
12155
+ await sc(i, r, `/store/products/${encodeURIComponent(f)}/questions`, {
11901
12156
  method: "POST",
11902
12157
  body: { question: x.trim() }
11903
12158
  }), S(""), E(o("questionPending")), b((e) => e + 1);
11904
12159
  } catch (e) {
11905
- e?.code === "LOGIN_REQUIRED" ? window.location.assign(l()) : E(pc(o, e));
12160
+ e?.code === "LOGIN_REQUIRED" ? window.location.assign(l()) : E(_c(o, e));
11906
12161
  } finally {
11907
12162
  w(!1);
11908
12163
  }
@@ -11948,7 +12203,7 @@ function Lc({ product: e, inert: t = !1, sample: n = !1 }) {
11948
12203
  type: "submit",
11949
12204
  disabled: C || x.trim().length < 3,
11950
12205
  ...Q("submit-button"),
11951
- style: Sc,
12206
+ style: Ec,
11952
12207
  children: o("submitQuestion")
11953
12208
  })]
11954
12209
  }) : /* @__PURE__ */ h("p", {
@@ -11964,7 +12219,7 @@ function Lc({ product: e, inert: t = !1, sample: n = !1 }) {
11964
12219
  ...Q("note"),
11965
12220
  style: {
11966
12221
  margin: 0,
11967
- color: vc
12222
+ color: Sc
11968
12223
  },
11969
12224
  children: T
11970
12225
  }),
@@ -11972,7 +12227,7 @@ function Lc({ product: e, inert: t = !1, sample: n = !1 }) {
11972
12227
  ...Q("empty"),
11973
12228
  style: {
11974
12229
  margin: 0,
11975
- color: vc
12230
+ color: Sc
11976
12231
  },
11977
12232
  children: o("noQuestions")
11978
12233
  }),
@@ -11985,7 +12240,7 @@ function Lc({ product: e, inert: t = !1, sample: n = !1 }) {
11985
12240
  ...Q("question"),
11986
12241
  style: {
11987
12242
  padding: "14px 0",
11988
- borderTop: yc,
12243
+ borderTop: Cc,
11989
12244
  display: "flex",
11990
12245
  flexDirection: "column",
11991
12246
  gap: "6px"
@@ -12026,7 +12281,7 @@ function Lc({ product: e, inert: t = !1, sample: n = !1 }) {
12026
12281
  ...Q("badge"),
12027
12282
  style: {
12028
12283
  fontSize: "12px",
12029
- color: vc
12284
+ color: Sc
12030
12285
  },
12031
12286
  children: o("awaitingAnswer")
12032
12287
  }),
@@ -12034,12 +12289,12 @@ function Lc({ product: e, inert: t = !1, sample: n = !1 }) {
12034
12289
  ...Q("meta"),
12035
12290
  style: {
12036
12291
  fontSize: "12px",
12037
- color: vc
12292
+ color: Sc
12038
12293
  },
12039
12294
  children: [
12040
12295
  e.author || o("anonymous"),
12041
12296
  " · ",
12042
- Ec(e.created_at, a)
12297
+ Ac(e.created_at, a)
12043
12298
  ]
12044
12299
  })
12045
12300
  ]
@@ -12050,7 +12305,7 @@ function Lc({ product: e, inert: t = !1, sample: n = !1 }) {
12050
12305
  onClick: () => v((e) => e + 10),
12051
12306
  ...Q("load-more"),
12052
12307
  style: {
12053
- ...Cc,
12308
+ ...Dc,
12054
12309
  alignSelf: "center"
12055
12310
  },
12056
12311
  children: o("loadMore")
@@ -12060,8 +12315,8 @@ function Lc({ product: e, inert: t = !1, sample: n = !1 }) {
12060
12315
  }
12061
12316
  //#endregion
12062
12317
  //#region ../ui/src/components/builder/apps/shop/specs.jsx
12063
- var Rc = "1px solid var(--page-border, #d1d5db)", zc = "var(--page-muted, rgba(100,116,139,1))", Bc = (e) => /^(https?:)?\/\//i.test(String(e)) || String(e).startsWith("/") ? String(e) : "";
12064
- function Vc(e, t, n, r) {
12318
+ var Hc = "1px solid var(--page-border, #d1d5db)", Uc = "var(--page-muted, rgba(100,116,139,1))", Wc = (e) => /^(https?:)?\/\//i.test(String(e)) || String(e).startsWith("/") ? String(e) : "";
12319
+ function Gc(e, t, n, r) {
12065
12320
  let i = n || void 0;
12066
12321
  switch (e.type) {
12067
12322
  case "integer":
@@ -12084,7 +12339,7 @@ function Vc(e, t, n, r) {
12084
12339
  gap: "6px"
12085
12340
  },
12086
12341
  children: [
12087
- n === 5 && /* @__PURE__ */ h(kc, { value: Number(t) }),
12342
+ n === 5 && /* @__PURE__ */ h(Nc, { value: Number(t) }),
12088
12343
  Number(t).toLocaleString(i),
12089
12344
  " / ",
12090
12345
  n
@@ -12116,12 +12371,12 @@ function Vc(e, t, n, r) {
12116
12371
  height: "14px",
12117
12372
  borderRadius: "4px",
12118
12373
  background: t,
12119
- border: Rc,
12374
+ border: Hc,
12120
12375
  display: "inline-block"
12121
12376
  } }), t]
12122
12377
  });
12123
12378
  case "link": {
12124
- let e = Bc(t);
12379
+ let e = Wc(t);
12125
12380
  return e ? /* @__PURE__ */ h("a", {
12126
12381
  href: e,
12127
12382
  target: "_blank",
@@ -12130,7 +12385,7 @@ function Vc(e, t, n, r) {
12130
12385
  children: t
12131
12386
  }) : String(t);
12132
12387
  }
12133
- case "image": return Bc(t) ? /* @__PURE__ */ h("img", {
12388
+ case "image": return Wc(t) ? /* @__PURE__ */ h("img", {
12134
12389
  src: t,
12135
12390
  alt: e.name,
12136
12391
  style: {
@@ -12141,14 +12396,14 @@ function Vc(e, t, n, r) {
12141
12396
  }
12142
12397
  }) : "";
12143
12398
  case "video":
12144
- case "file": return Bc(t) ? /* @__PURE__ */ h("a", {
12399
+ case "file": return Wc(t) ? /* @__PURE__ */ h("a", {
12145
12400
  href: t,
12146
12401
  target: "_blank",
12147
12402
  rel: "noopener noreferrer",
12148
12403
  style: { color: "var(--page-accent, #111827)" },
12149
12404
  children: String(t).split("/").pop()
12150
12405
  }) : "";
12151
- case "media": return (Array.isArray(t) ? t : [t]).filter(Bc).map((e, t) => /* @__PURE__ */ h("a", {
12406
+ case "media": return (Array.isArray(t) ? t : [t]).filter(Wc).map((e, t) => /* @__PURE__ */ h("a", {
12152
12407
  href: e,
12153
12408
  target: "_blank",
12154
12409
  rel: "noopener noreferrer",
@@ -12188,7 +12443,7 @@ function Vc(e, t, n, r) {
12188
12443
  default: return String(t);
12189
12444
  }
12190
12445
  }
12191
- function Hc({ specs: e, locale: t, words: n }) {
12446
+ function Kc({ specs: e, locale: t, words: n }) {
12192
12447
  return !Array.isArray(e) || !e.length ? null : /* @__PURE__ */ g("section", {
12193
12448
  ...Q("specs"),
12194
12449
  style: {
@@ -12207,7 +12462,7 @@ function Hc({ specs: e, locale: t, words: n }) {
12207
12462
  role: "table",
12208
12463
  ...Q("specs-table"),
12209
12464
  style: {
12210
- border: Rc,
12465
+ border: Hc,
12211
12466
  borderRadius: "10px",
12212
12467
  overflow: "hidden"
12213
12468
  },
@@ -12221,13 +12476,13 @@ function Hc({ specs: e, locale: t, words: n }) {
12221
12476
  gridTemplateColumns: "minmax(120px, 34%) 1fr",
12222
12477
  gap: "16px",
12223
12478
  padding: "10px 14px",
12224
- borderTop: r ? Rc : 0,
12479
+ borderTop: r ? Hc : 0,
12225
12480
  fontSize: "14px"
12226
12481
  },
12227
12482
  children: [/* @__PURE__ */ h("span", {
12228
12483
  role: "rowheader",
12229
12484
  ...Q("spec-name"),
12230
- style: { color: zc },
12485
+ style: { color: Uc },
12231
12486
  children: e.name
12232
12487
  }), /* @__PURE__ */ h("span", {
12233
12488
  role: "cell",
@@ -12238,7 +12493,7 @@ function Hc({ specs: e, locale: t, words: n }) {
12238
12493
  gap: "4px 10px",
12239
12494
  alignItems: "center"
12240
12495
  },
12241
- children: i.map((r, a) => /* @__PURE__ */ g("span", { children: [Vc(e, r, t, n), a < i.length - 1 && e.type !== "color" ? "," : ""] }, a))
12496
+ children: i.map((r, a) => /* @__PURE__ */ g("span", { children: [Gc(e, r, t, n), a < i.length - 1 && e.type !== "color" ? "," : ""] }, a))
12242
12497
  })]
12243
12498
  }, e.key);
12244
12499
  })
@@ -12247,7 +12502,7 @@ function Hc({ specs: e, locale: t, words: n }) {
12247
12502
  }
12248
12503
  //#endregion
12249
12504
  //#region ../ui/src/components/builder/apps/shop/views.jsx
12250
- var $ = "var(--page-muted, rgba(100,116,139,1))", Uc = "1px solid var(--page-border, #d1d5db)", Wc = "var(--page-surface, #f2f2f2)", Gc = {
12505
+ var $ = "var(--page-muted, rgba(100,116,139,1))", qc = "1px solid var(--page-border, #d1d5db)", Jc = "var(--page-surface, #f2f2f2)", Yc = {
12251
12506
  ...Ir,
12252
12507
  border: 0,
12253
12508
  borderRadius: "8px",
@@ -12256,14 +12511,14 @@ var $ = "var(--page-muted, rgba(100,116,139,1))", Uc = "1px solid var(--page-bor
12256
12511
  fontWeight: 600,
12257
12512
  fontFamily: "inherit",
12258
12513
  textAlign: "center"
12259
- }, Kc = {
12260
- ...Gc,
12514
+ }, Xc = {
12515
+ ...Yc,
12261
12516
  backgroundColor: "transparent",
12262
12517
  color: "var(--page-text, #111827)",
12263
- border: Uc
12518
+ border: qc
12264
12519
  };
12265
- function qc() {
12266
- let { tenant: e, apiUrl: t, locale: n, param: r, settings: i } = o(Z), s = l(() => fc(n), [n]), c = i?.["shop.orderPrefix"], u = i?.["shop.orderSuffix"], d = a((e) => `${typeof c == "string" ? c : "#"}${e}${typeof u == "string" ? u : ""}`, [c, u]);
12520
+ function Zc() {
12521
+ let { tenant: e, apiUrl: t, locale: n, param: r, settings: i } = o(Z), s = l(() => gc(n), [n]), c = i?.["shop.orderPrefix"], u = i?.["shop.orderSuffix"], d = a((e) => `${typeof c == "string" ? c : "#"}${e}${typeof u == "string" ? u : ""}`, [c, u]);
12267
12522
  return {
12268
12523
  tenant: e,
12269
12524
  apiUrl: t || "/api",
@@ -12273,8 +12528,8 @@ function qc() {
12273
12528
  orderId: d
12274
12529
  };
12275
12530
  }
12276
- function Jc(e, t, n = !0) {
12277
- let r = l(() => oc(e, t), [e, t]), i = f(r.subscribe, r.getState, r.getState);
12531
+ function Qc(e, t, n = !0) {
12532
+ let r = l(() => uc(e, t), [e, t]), i = f(r.subscribe, r.getState, r.getState);
12278
12533
  return s(() => {
12279
12534
  n && !i.loaded && !i.loading && r.load();
12280
12535
  }, [n, r]), {
@@ -12282,8 +12537,8 @@ function Jc(e, t, n = !0) {
12282
12537
  ...i
12283
12538
  };
12284
12539
  }
12285
- var Yc = (e) => typeof window > "u" ? "" : new URLSearchParams(window.location.search).get(e) ?? "";
12286
- function Xc({ value: e, label: t, onCommit: n }) {
12540
+ var $c = (e) => typeof window > "u" ? "" : new URLSearchParams(window.location.search).get(e) ?? "";
12541
+ function el({ value: e, label: t, onCommit: n }) {
12287
12542
  let [r, i] = d(null), a = () => {
12288
12543
  if (r === null) return;
12289
12544
  let t = Math.max(1, Math.round(Number(r)) || 1);
@@ -12307,12 +12562,12 @@ function Xc({ value: e, label: t, onCommit: n }) {
12307
12562
  }
12308
12563
  });
12309
12564
  }
12310
- var Zc = "/product/{slug}", Qc = (e) => !e || e === "/product?product={slug}" ? Zc : e, $c = (e, t) => String(Qc(e)).replace(/\{slug\}/g, encodeURIComponent(t.slug)).replace(/\{id\}/g, t.id);
12311
- function el(e) {
12565
+ var tl = "/product/{slug}", nl = (e) => !e || e === "/product?product={slug}" ? tl : e, rl = (e, t) => String(nl(e)).replace(/\{slug\}/g, encodeURIComponent(t.slug)).replace(/\{id\}/g, t.id);
12566
+ function il(e) {
12312
12567
  let t = e.variants?.length ? e.variants.map((e) => e.stock) : [e.stock];
12313
12568
  return t.some((e) => e == null) ? null : t.reduce((e, t) => e + Number(t), 0);
12314
12569
  }
12315
- function tl({ product: e, variant: t, locale: n, size: r = 16 }) {
12570
+ function al({ product: e, variant: t, locale: n, size: r = 16 }) {
12316
12571
  let i = e.currency, a = t?.price ?? e.price;
12317
12572
  return /* @__PURE__ */ g("span", {
12318
12573
  ...Q("price"),
@@ -12325,7 +12580,7 @@ function tl({ product: e, variant: t, locale: n, size: r = 16 }) {
12325
12580
  children: [/* @__PURE__ */ h("span", {
12326
12581
  ...Q("price-current"),
12327
12582
  style: { fontWeight: 700 },
12328
- children: uc(a, i, n)
12583
+ children: mc(a, i, n)
12329
12584
  }), e.compare_at_price > a && /* @__PURE__ */ h("span", {
12330
12585
  ...Q("price-old"),
12331
12586
  style: {
@@ -12333,11 +12588,11 @@ function tl({ product: e, variant: t, locale: n, size: r = 16 }) {
12333
12588
  textDecoration: "line-through",
12334
12589
  fontSize: "0.85em"
12335
12590
  },
12336
- children: uc(e.compare_at_price, i, n)
12591
+ children: mc(e.compare_at_price, i, n)
12337
12592
  })]
12338
12593
  });
12339
12594
  }
12340
- var nl = [
12595
+ var ol = [
12341
12596
  1,
12342
12597
  2,
12343
12598
  3
@@ -12353,17 +12608,17 @@ var nl = [
12353
12608
  currency: "USD",
12354
12609
  sample: !0
12355
12610
  }));
12356
- function rl({ 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 }) {
12357
- let { tenant: y, apiUrl: b, locale: x, words: S } = qc(), C = wc(), [w, T] = d(null), [E, D] = d(null), [O, k] = d(""), [A, j] = d({}), [M, N] = d(!1), { store: P, currency: F } = Jc(b, y, !m), I = l === "favorites";
12611
+ function sl({ 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 }) {
12612
+ let { tenant: y, apiUrl: b, locale: x, words: S } = Zc(), C = Oc(), [w, T] = d(null), [E, D] = d(null), [O, k] = d(""), [A, j] = d({}), [M, N] = d(!1), { store: P, currency: F } = Qc(b, y, !m), I = l === "favorites";
12358
12613
  s(() => {
12359
12614
  let e = !0, n = Math.max(1, Math.min(100, Number(t) || 12)), r = F ? `&currency=${encodeURIComponent(F)}` : "";
12360
12615
  if (I && m) {
12361
12616
  T([]);
12362
12617
  return;
12363
12618
  }
12364
- return N(!1), Promise.all([rc(b, y, I ? `/store/my/favorites?limit=${n}${r}` : `/store/products?limit=${n}${r}${c ? `&collection=${encodeURIComponent(c)}` : ""}`), rc(b, y, "/store/config")]).then(([t, n]) => {
12619
+ return N(!1), Promise.all([sc(b, y, I ? `/store/my/favorites?limit=${n}${r}` : `/store/products?limit=${n}${r}${c ? `&collection=${encodeURIComponent(c)}` : ""}`), sc(b, y, "/store/config")]).then(([t, n]) => {
12365
12620
  if (!e) return;
12366
- let r = sc(n, F);
12621
+ let r = dc(n, F);
12367
12622
  D(n), T(Array.isArray(t?.data) ? t.data.map((e) => ({
12368
12623
  ...e,
12369
12624
  currency: r
@@ -12382,7 +12637,7 @@ function rl({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
12382
12637
  I,
12383
12638
  m
12384
12639
  ]);
12385
- let L = w?.length || !_ ? w ?? [] : nl, R = async (e) => {
12640
+ let L = w?.length || !_ ? w ?? [] : ol, R = async (e) => {
12386
12641
  if (!(m || e.sample)) {
12387
12642
  k(e.id);
12388
12643
  try {
@@ -12393,7 +12648,7 @@ function rl({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
12393
12648
  } catch (t) {
12394
12649
  j((n) => ({
12395
12650
  ...n,
12396
- [e.id]: pc(S, t)
12651
+ [e.id]: _c(S, t)
12397
12652
  }));
12398
12653
  } finally {
12399
12654
  k("");
@@ -12438,7 +12693,7 @@ function rl({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
12438
12693
  gap: `${n}px`
12439
12694
  },
12440
12695
  children: L.map((e) => {
12441
- let t = el(e) === 0, n = $c(r, e);
12696
+ let t = il(e) === 0, n = rl(r, e);
12442
12697
  return /* @__PURE__ */ g("div", {
12443
12698
  ...Q("card"),
12444
12699
  style: {
@@ -12461,7 +12716,7 @@ function rl({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
12461
12716
  aspectRatio: "1 / 1",
12462
12717
  borderRadius: "10px",
12463
12718
  overflow: "hidden",
12464
- background: Wc
12719
+ background: Jc
12465
12720
  },
12466
12721
  children: e.images?.[0] && /* @__PURE__ */ h("img", {
12467
12722
  src: e.images[0],
@@ -12494,16 +12749,16 @@ function rl({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
12494
12749
  color: $
12495
12750
  },
12496
12751
  children: [
12497
- /* @__PURE__ */ h(kc, {
12752
+ /* @__PURE__ */ h(Nc, {
12498
12753
  value: Number(e.rating_avg),
12499
12754
  size: 14
12500
12755
  }),
12501
12756
  "(",
12502
- Tc(e.rating_count, x),
12757
+ kc(e.rating_count, x),
12503
12758
  ")"
12504
12759
  ]
12505
12760
  }),
12506
- /* @__PURE__ */ h(tl, {
12761
+ /* @__PURE__ */ h(al, {
12507
12762
  product: e,
12508
12763
  locale: x
12509
12764
  }),
@@ -12512,7 +12767,7 @@ function rl({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
12512
12767
  onClick: v ? (e) => e.preventDefault() : void 0,
12513
12768
  ...Q("choose-button"),
12514
12769
  style: {
12515
- ...Kc,
12770
+ ...Xc,
12516
12771
  display: "block"
12517
12772
  },
12518
12773
  children: S("choose")
@@ -12522,7 +12777,7 @@ function rl({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
12522
12777
  onClick: () => R(e),
12523
12778
  ...Q("add-button", t && "add-button-sold-out"),
12524
12779
  style: {
12525
- ...Gc,
12780
+ ...Yc,
12526
12781
  opacity: t ? .5 : 1
12527
12782
  },
12528
12783
  children: t ? S("soldOut") : O === e.id ? S("adding") : a || S("add")
@@ -12542,24 +12797,24 @@ function rl({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
12542
12797
  ]
12543
12798
  });
12544
12799
  }
12545
- function il({ 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 }) {
12546
- let { tenant: f, apiUrl: p, locale: m, param: _, words: v } = qc(), [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 } = Jc(p, f, !c), F = e || _ || Yc("product"), I = P ? `?currency=${encodeURIComponent(P)}` : "";
12800
+ function cl({ 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 }) {
12801
+ let { tenant: f, apiUrl: p, locale: m, param: _, words: v } = Zc(), [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 } = Qc(p, f, !c), F = e || _ || $c("product"), I = P ? `?currency=${encodeURIComponent(P)}` : "";
12547
12802
  if (s(() => {
12548
12803
  let e = !0;
12549
12804
  return S(!1), (async () => {
12550
- let t = await rc(p, f, "/store/config"), n = F ? await rc(p, f, `/store/products/${encodeURIComponent(F)}${I}`) : l || u ? (await rc(p, f, `/store/products?limit=1${P ? `&currency=${encodeURIComponent(P)}` : ""}`))?.data?.[0] : null;
12805
+ let t = await sc(p, f, "/store/config"), n = F ? await sc(p, f, `/store/products/${encodeURIComponent(F)}${I}`) : l || u ? (await sc(p, f, `/store/products?limit=1${P ? `&currency=${encodeURIComponent(P)}` : ""}`))?.data?.[0] : null;
12551
12806
  if (e) {
12552
12807
  if (!n) {
12553
- S(!0), b(l ? nl[0] : null);
12808
+ S(!0), b(l ? ol[0] : null);
12554
12809
  return;
12555
12810
  }
12556
12811
  b({
12557
12812
  ...n,
12558
- currency: sc(t, P)
12813
+ currency: dc(t, P)
12559
12814
  }), E((e) => n.variants?.some((t) => t.id === e) ? e : n.variants?.[0]?.id ?? ""), w(0);
12560
12815
  }
12561
12816
  })().catch(() => {
12562
- e && (S(!0), b(l ? nl[0] : null));
12817
+ e && (S(!0), b(l ? ol[0] : null));
12563
12818
  }), () => {
12564
12819
  e = !1;
12565
12820
  };
@@ -12586,7 +12841,7 @@ function il({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
12586
12841
  try {
12587
12842
  await N.add(y.id, L?.id ?? null, Math.max(1, Number(D) || 1)), M(v("added"));
12588
12843
  } catch (e) {
12589
- M(pc(v, e));
12844
+ M(_c(v, e));
12590
12845
  } finally {
12591
12846
  A(!1);
12592
12847
  }
@@ -12621,7 +12876,7 @@ function il({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
12621
12876
  aspectRatio: "1 / 1",
12622
12877
  borderRadius: "12px",
12623
12878
  overflow: "hidden",
12624
- background: Wc
12879
+ background: Jc
12625
12880
  },
12626
12881
  children: y.images?.[C] && /* @__PURE__ */ h("img", {
12627
12882
  src: y.images[C],
@@ -12652,8 +12907,8 @@ function il({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
12652
12907
  borderRadius: "8px",
12653
12908
  overflow: "hidden",
12654
12909
  cursor: "pointer",
12655
- border: t === C ? "2px solid var(--page-accent, #111827)" : Uc,
12656
- background: Wc
12910
+ border: t === C ? "2px solid var(--page-accent, #111827)" : qc,
12911
+ background: Jc
12657
12912
  },
12658
12913
  children: /* @__PURE__ */ h("img", {
12659
12914
  src: e,
@@ -12684,12 +12939,12 @@ function il({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
12684
12939
  },
12685
12940
  children: y.name
12686
12941
  }),
12687
- /* @__PURE__ */ h(Nc, {
12942
+ /* @__PURE__ */ h(Lc, {
12688
12943
  product: y,
12689
12944
  inert: c,
12690
12945
  sample: l && !!y.sample
12691
12946
  }),
12692
- /* @__PURE__ */ h(tl, {
12947
+ /* @__PURE__ */ h(al, {
12693
12948
  product: y,
12694
12949
  variant: L,
12695
12950
  locale: m,
@@ -12710,7 +12965,7 @@ function il({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
12710
12965
  onClick: () => E(e.id),
12711
12966
  ...Q("variant", e.id === T && "variant-selected", t && "variant-sold-out"),
12712
12967
  style: {
12713
- ...Kc,
12968
+ ...Xc,
12714
12969
  padding: "8px 14px",
12715
12970
  opacity: t ? .45 : 1,
12716
12971
  textDecoration: t ? "line-through" : "none",
@@ -12745,7 +13000,7 @@ function il({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
12745
13000
  onClick: B,
12746
13001
  ...Q("add-button", z && "add-button-sold-out"),
12747
13002
  style: {
12748
- ...Gc,
13003
+ ...Yc,
12749
13004
  flex: 1,
12750
13005
  opacity: z ? .5 : 1
12751
13006
  },
@@ -12776,17 +13031,17 @@ function il({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
12776
13031
  ]
12777
13032
  })]
12778
13033
  }),
12779
- i && /* @__PURE__ */ h(Hc, {
13034
+ i && /* @__PURE__ */ h(Kc, {
12780
13035
  specs: y.specs,
12781
13036
  locale: m,
12782
13037
  words: v
12783
13038
  }),
12784
- n && /* @__PURE__ */ h(Fc, {
13039
+ n && /* @__PURE__ */ h(zc, {
12785
13040
  product: y,
12786
13041
  inert: c,
12787
13042
  sample: l && !!y.sample
12788
13043
  }),
12789
- r && /* @__PURE__ */ h(Lc, {
13044
+ r && /* @__PURE__ */ h(Vc, {
12790
13045
  product: y,
12791
13046
  inert: c,
12792
13047
  sample: l && !!y.sample
@@ -12794,13 +13049,13 @@ function il({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
12794
13049
  ]
12795
13050
  });
12796
13051
  }
12797
- function al(e) {
12798
- return /* @__PURE__ */ h(rl, {
13052
+ function ll(e) {
13053
+ return /* @__PURE__ */ h(sl, {
12799
13054
  ...e,
12800
13055
  source: "favorites"
12801
13056
  });
12802
13057
  }
12803
- var ol = /* @__PURE__ */ g("svg", {
13058
+ var ul = /* @__PURE__ */ g("svg", {
12804
13059
  width: "20",
12805
13060
  height: "20",
12806
13061
  viewBox: "0 0 24 24",
@@ -12813,8 +13068,8 @@ var ol = /* @__PURE__ */ g("svg", {
12813
13068
  ...Q("icon"),
12814
13069
  children: [/* @__PURE__ */ h("path", { d: "M6 7h12l-1 13H7L6 7Z" }), /* @__PURE__ */ h("path", { d: "M9 7a3 3 0 0 1 6 0" })]
12815
13070
  });
12816
- function sl({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nodeRef: i, inert: a = !1, sample: o = !1, noNavigate: s = !1 }) {
12817
- let { tenant: c, apiUrl: l, words: u } = qc(), { cart: d } = Jc(l, c, !a), f = o && !d.count ? 2 : d.count;
13071
+ function dl({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nodeRef: i, inert: a = !1, sample: o = !1, noNavigate: s = !1 }) {
13072
+ let { tenant: c, apiUrl: l, words: u } = Zc(), { cart: d } = Qc(l, c, !a), f = o && !d.count ? 2 : d.count;
12818
13073
  return /* @__PURE__ */ g("a", {
12819
13074
  ref: i,
12820
13075
  href: e,
@@ -12831,7 +13086,7 @@ function sl({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
12831
13086
  ...Y(r)
12832
13087
  },
12833
13088
  children: [
12834
- ol,
13089
+ ul,
12835
13090
  n && /* @__PURE__ */ h("span", {
12836
13091
  ...Q("label"),
12837
13092
  children: t || u("cart")
@@ -12859,7 +13114,7 @@ function sl({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
12859
13114
  ]
12860
13115
  });
12861
13116
  }
12862
- function cl(e, t, n) {
13117
+ function fl(e, t, n) {
12863
13118
  if (t === "code") return e;
12864
13119
  try {
12865
13120
  if (t === "name") return `${new Intl.DisplayNames([n || "en"], { type: "currency" }).of(e) ?? e} (${e})`;
@@ -12872,8 +13127,8 @@ function cl(e, t, n) {
12872
13127
  return e;
12873
13128
  }
12874
13129
  }
12875
- function ll({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert: i = !1 }) {
12876
- let { tenant: a, apiUrl: o, locale: c } = qc(), { store: l, currency: u } = Jc(o, a, !i), [f, p] = d(null), m = {
13130
+ function pl({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert: i = !1 }) {
13131
+ let { tenant: a, apiUrl: o, locale: c } = Zc(), { store: l, currency: u } = Qc(o, a, !i), [f, p] = d(null), m = {
12877
13132
  display: "inline-flex",
12878
13133
  alignItems: "center",
12879
13134
  gap: 8,
@@ -12881,7 +13136,7 @@ function ll({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
12881
13136
  };
12882
13137
  s(() => {
12883
13138
  let e = !0;
12884
- return rc(o, a, "/store/config").then((t) => e && p(t)).catch(() => e && p({ currencies: [] })), () => {
13139
+ return sc(o, a, "/store/config").then((t) => e && p(t)).catch(() => e && p({ currencies: [] })), () => {
12885
13140
  e = !1;
12886
13141
  };
12887
13142
  }, [o, a]);
@@ -12907,7 +13162,7 @@ function ll({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
12907
13162
  }) : null, /* @__PURE__ */ h("select", {
12908
13163
  "aria-label": t || "Currency",
12909
13164
  ...Q("select"),
12910
- value: sc(f, u),
13165
+ value: dc(f, u),
12911
13166
  onChange: i ? void 0 : (e) => l.setCurrency(e.target.value === f.currency ? "" : e.target.value),
12912
13167
  onKeyDown: i ? (e) => e.preventDefault() : void 0,
12913
13168
  style: {
@@ -12921,24 +13176,24 @@ function ll({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
12921
13176
  },
12922
13177
  children: _.map((t) => /* @__PURE__ */ h("option", {
12923
13178
  value: t,
12924
- children: cl(t, e, c)
13179
+ children: fl(t, e, c)
12925
13180
  }, t))
12926
13181
  })]
12927
13182
  });
12928
13183
  }
12929
- var ul = {
13184
+ var ml = {
12930
13185
  display: "flex",
12931
13186
  flexDirection: "column",
12932
13187
  gap: "6px",
12933
13188
  fontSize: "13px"
12934
- }, dl = {
13189
+ }, hl = {
12935
13190
  margin: "0 0 12px",
12936
13191
  fontSize: "18px"
12937
13192
  };
12938
- function fl({ label: e, required: t, children: n }) {
13193
+ function gl({ label: e, required: t, children: n }) {
12939
13194
  return /* @__PURE__ */ g("label", {
12940
13195
  ...Q("field"),
12941
- style: ul,
13196
+ style: ml,
12942
13197
  children: [/* @__PURE__ */ g("span", {
12943
13198
  ...Q("field-label"),
12944
13199
  style: { fontWeight: 500 },
@@ -12950,7 +13205,7 @@ function fl({ label: e, required: t, children: n }) {
12950
13205
  }), n]
12951
13206
  });
12952
13207
  }
12953
- var pl = [{
13208
+ var _l = [{
12954
13209
  id: "ship:standard",
12955
13210
  type: "shipping",
12956
13211
  name: "Standard",
@@ -12966,7 +13221,7 @@ var pl = [{
12966
13221
  min_days: null,
12967
13222
  max_days: null,
12968
13223
  detail: "Main Street 1"
12969
- }], ml = {
13224
+ }], vl = {
12970
13225
  name: "",
12971
13226
  email: "",
12972
13227
  phone: "",
@@ -12981,25 +13236,25 @@ var pl = [{
12981
13236
  recipient: "",
12982
13237
  gift_message: ""
12983
13238
  };
12984
- function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample: i = !1, noNavigate: a = !1 }) {
12985
- let { tenant: o, apiUrl: c, locale: u, words: f, orderId: p } = qc(), { store: m, cart: _, loaded: v } = Jc(c, o, !r), [y, b] = d(null), [x, S] = d(ml), [C, w] = d(""), [T, E] = d(!1), [D, O] = d(""), [k, A] = d(null), [j, M] = d(""), [N, P] = d(!1), F = !r && Yc("cancelled") === "1", I = (e) => uc(e, _.currency || y?.currency, u);
13239
+ function yl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample: i = !1, noNavigate: a = !1 }) {
13240
+ let { tenant: o, apiUrl: c, locale: u, words: f, orderId: p } = Zc(), { store: m, cart: _, loaded: v } = Qc(c, o, !r), [y, b] = d(null), [x, S] = d(vl), [C, w] = d(""), [T, E] = d(!1), [D, O] = d(""), [k, A] = d(null), [j, M] = d(""), [N, P] = d(!1), F = !r && $c("cancelled") === "1", I = (e) => mc(e, _.currency || y?.currency, u);
12986
13241
  s(() => {
12987
- rc(c, o, "/store/config").then((e) => {
13242
+ sc(c, o, "/store/config").then((e) => {
12988
13243
  b(e), w((t) => t || e?.methods?.[0] || "");
12989
13244
  }).catch(() => b({
12990
13245
  enabled: !1,
12991
13246
  methods: []
12992
13247
  }));
12993
13248
  }, [c, o]), s(() => {
12994
- let e = Yc("order");
12995
- r || !e || F || rc(c, o, `/store/orders/${encodeURIComponent(e)}`).then((e) => {
13249
+ let e = $c("order");
13250
+ r || !e || F || sc(c, o, `/store/orders/${encodeURIComponent(e)}`).then((e) => {
12996
13251
  A(e), e?.payment_status === "paid" && m.reset();
12997
- }).catch((e) => O(pc(f, e)));
13252
+ }).catch((e) => O(_c(f, e)));
12998
13253
  }, [c, o]);
12999
13254
  let L = (e) => (t) => S((n) => ({
13000
13255
  ...n,
13001
13256
  [e]: t.target.value
13002
- })), R = l(() => lc(u, y?.zone_countries ?? [], y && !y.ships_elsewhere && y.zone_countries?.length ? y.zone_countries : null), [u, y]);
13257
+ })), R = l(() => pc(u, y?.zone_countries ?? [], y && !y.ships_elsewhere && y.zone_countries?.length ? y.zone_countries : null), [u, y]);
13003
13258
  s(() => {
13004
13259
  _.country && !x.country && S((e) => ({
13005
13260
  ...e,
@@ -13012,7 +13267,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13012
13267
  try {
13013
13268
  await m.setCoupon(e), M("");
13014
13269
  } catch (e) {
13015
- O(pc(f, e));
13270
+ O(_c(f, e));
13016
13271
  } finally {
13017
13272
  P(!1);
13018
13273
  }
@@ -13037,7 +13292,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13037
13292
  "paid",
13038
13293
  "cancelled"
13039
13294
  ].forEach((t) => e.searchParams.delete(t));
13040
- let t = await rc(c, o, "/store/checkout", {
13295
+ let t = await sc(c, o, "/store/checkout", {
13041
13296
  method: "POST",
13042
13297
  body: {
13043
13298
  cart_id: m.cartId(),
@@ -13069,13 +13324,13 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13069
13324
  }
13070
13325
  A(t?.order ?? null), m.reset();
13071
13326
  } catch (e) {
13072
- O(pc(f, e));
13327
+ O(_c(f, e));
13073
13328
  } finally {
13074
13329
  E(!1);
13075
13330
  }
13076
13331
  }
13077
- }, V = { ...Y(t) }, H = r && i && !_.lines.length ? !0 : _.requires_shipping !== !1, U = Array.isArray(_.discounts) ? _.discounts : [], W = U.filter((e) => e.type !== "shipping"), G = U.find((e) => e.type === "shipping") ?? null, K = r && i && !_.lines.length ? pl : Array.isArray(_.delivery_options) ? _.delivery_options : [], q = K.find((e) => e.id === _.delivery) ?? (r && i ? K[0] : null), ee = q?.type === "pickup", te = (e) => {
13078
- r || e === _.delivery || (O(""), m.setDelivery(e).catch((e) => O(pc(f, e))));
13332
+ }, V = { ...Y(t) }, H = r && i && !_.lines.length ? !0 : _.requires_shipping !== !1, U = Array.isArray(_.discounts) ? _.discounts : [], W = U.filter((e) => e.type !== "shipping"), G = U.find((e) => e.type === "shipping") ?? null, K = r && i && !_.lines.length ? _l : Array.isArray(_.delivery_options) ? _.delivery_options : [], q = K.find((e) => e.id === _.delivery) ?? (r && i ? K[0] : null), ee = q?.type === "pickup", te = (e) => {
13333
+ r || e === _.delivery || (O(""), m.setDelivery(e).catch((e) => O(_c(f, e))));
13079
13334
  };
13080
13335
  if (k) {
13081
13336
  let t = k.payment_status === "paid";
@@ -13103,7 +13358,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13103
13358
  style: {
13104
13359
  padding: "12px",
13105
13360
  borderRadius: "8px",
13106
- background: Wc
13361
+ background: Jc
13107
13362
  },
13108
13363
  children: ii(k.instructions_content)
13109
13364
  }) : k.instructions ? /* @__PURE__ */ h("pre", {
@@ -13112,7 +13367,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13112
13367
  margin: 0,
13113
13368
  padding: "12px",
13114
13369
  borderRadius: "8px",
13115
- background: Wc,
13370
+ background: Jc,
13116
13371
  whiteSpace: "pre-wrap",
13117
13372
  fontFamily: "inherit"
13118
13373
  },
@@ -13123,7 +13378,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13123
13378
  style: {
13124
13379
  padding: "12px",
13125
13380
  borderRadius: "8px",
13126
- background: Wc
13381
+ background: Jc
13127
13382
  },
13128
13383
  children: [
13129
13384
  /* @__PURE__ */ h("div", {
@@ -13147,13 +13402,13 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13147
13402
  /* @__PURE__ */ h("div", { children: f("pickupNote") })
13148
13403
  ]
13149
13404
  }),
13150
- !k.delivery.location && _c(f, u, k.delivery.min_days, k.delivery.max_days) && /* @__PURE__ */ h("div", {
13405
+ !k.delivery.location && xc(f, u, k.delivery.min_days, k.delivery.max_days) && /* @__PURE__ */ h("div", {
13151
13406
  ...Q("delivery-detail"),
13152
13407
  style: {
13153
13408
  fontSize: "14px",
13154
13409
  color: $
13155
13410
  },
13156
- children: _c(f, u, k.delivery.min_days, k.delivery.max_days)
13411
+ children: xc(f, u, k.delivery.min_days, k.delivery.max_days)
13157
13412
  })
13158
13413
  ]
13159
13414
  }),
@@ -13166,14 +13421,14 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13166
13421
  children: [
13167
13422
  f("total"),
13168
13423
  ": ",
13169
- uc(k.total, k.currency, u)
13424
+ mc(k.total, k.currency, u)
13170
13425
  ]
13171
13426
  }),
13172
- !t && /* @__PURE__ */ h(bl, {
13427
+ !t && /* @__PURE__ */ h(wl, {
13173
13428
  reference: k.transfer_reference,
13174
13429
  words: f
13175
13430
  }),
13176
- /* @__PURE__ */ h(xl, {
13431
+ /* @__PURE__ */ h(Tl, {
13177
13432
  downloads: k.downloads,
13178
13433
  apiUrl: c,
13179
13434
  words: f,
@@ -13185,7 +13440,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13185
13440
  onClick: a ? (e) => e.preventDefault() : void 0,
13186
13441
  ...Q("continue-button"),
13187
13442
  style: {
13188
- ...Kc,
13443
+ ...Xc,
13189
13444
  alignSelf: "flex-start"
13190
13445
  },
13191
13446
  children: f("continue")
@@ -13193,7 +13448,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13193
13448
  ]
13194
13449
  });
13195
13450
  }
13196
- let J = r && i && !_.lines.length ? nl.slice(0, 2).map((e) => ({
13451
+ let J = r && i && !_.lines.length ? ol.slice(0, 2).map((e) => ({
13197
13452
  ...e,
13198
13453
  product_id: e.id,
13199
13454
  variant_id: null,
@@ -13239,7 +13494,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13239
13494
  onClick: a ? (e) => e.preventDefault() : void 0,
13240
13495
  ...Q("continue-button"),
13241
13496
  style: {
13242
- ...Kc,
13497
+ ...Xc,
13243
13498
  alignSelf: "flex-start"
13244
13499
  },
13245
13500
  children: f("continue")
@@ -13277,7 +13532,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13277
13532
  ...Q("section"),
13278
13533
  children: [/* @__PURE__ */ h("h3", {
13279
13534
  ...Q("heading"),
13280
- style: dl,
13535
+ style: hl,
13281
13536
  children: f("contact")
13282
13537
  }), /* @__PURE__ */ g("div", {
13283
13538
  ...Q("fields"),
@@ -13285,7 +13540,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13285
13540
  display: "grid",
13286
13541
  gap: "12px"
13287
13542
  },
13288
- children: [/* @__PURE__ */ h(fl, {
13543
+ children: [/* @__PURE__ */ h(gl, {
13289
13544
  label: f("name"),
13290
13545
  required: !0,
13291
13546
  children: /* @__PURE__ */ h("input", {
@@ -13302,7 +13557,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13302
13557
  gridTemplateColumns: "1fr 1fr",
13303
13558
  gap: "12px"
13304
13559
  },
13305
- children: [/* @__PURE__ */ h(fl, {
13560
+ children: [/* @__PURE__ */ h(gl, {
13306
13561
  label: f("email"),
13307
13562
  required: !0,
13308
13563
  children: /* @__PURE__ */ h("input", {
@@ -13313,7 +13568,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13313
13568
  onChange: L("email"),
13314
13569
  autoComplete: "email"
13315
13570
  })
13316
- }), /* @__PURE__ */ h(fl, {
13571
+ }), /* @__PURE__ */ h(gl, {
13317
13572
  label: f("phone"),
13318
13573
  children: /* @__PURE__ */ h("input", {
13319
13574
  type: "tel",
@@ -13332,7 +13587,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13332
13587
  children: [
13333
13588
  /* @__PURE__ */ h("h3", {
13334
13589
  ...Q("heading"),
13335
- style: dl,
13590
+ style: hl,
13336
13591
  children: f("delivery")
13337
13592
  }),
13338
13593
  /* @__PURE__ */ h("div", {
@@ -13344,17 +13599,17 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13344
13599
  gridTemplateColumns: "1fr 1fr",
13345
13600
  gap: "12px"
13346
13601
  },
13347
- children: [/* @__PURE__ */ h(fl, {
13602
+ children: [/* @__PURE__ */ h(gl, {
13348
13603
  label: f("postal"),
13349
13604
  children: /* @__PURE__ */ h("input", {
13350
13605
  ...Q("input"),
13351
13606
  style: ha,
13352
13607
  value: x.postal_code,
13353
13608
  onChange: L("postal_code"),
13354
- onBlur: () => !r && x.country && m.setCountry(x.country, x.postal_code).catch((e) => O(pc(f, e))),
13609
+ onBlur: () => !r && x.country && m.setCountry(x.country, x.postal_code).catch((e) => O(_c(f, e))),
13355
13610
  autoComplete: "postal-code"
13356
13611
  })
13357
- }), /* @__PURE__ */ h(fl, {
13612
+ }), /* @__PURE__ */ h(gl, {
13358
13613
  label: f("country"),
13359
13614
  required: !ee,
13360
13615
  children: /* @__PURE__ */ g("select", {
@@ -13367,7 +13622,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13367
13622
  S((e) => ({
13368
13623
  ...e,
13369
13624
  country: t
13370
- })), r || m.setCountry(t, x.postal_code).catch((e) => O(pc(f, e)));
13625
+ })), r || m.setCountry(t, x.postal_code).catch((e) => O(_c(f, e)));
13371
13626
  },
13372
13627
  children: [/* @__PURE__ */ h("option", {
13373
13628
  value: "",
@@ -13396,7 +13651,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13396
13651
  gap: "8px"
13397
13652
  },
13398
13653
  children: K.map((e) => {
13399
- let t = _c(f, u, e.min_days, e.max_days);
13654
+ let t = xc(f, u, e.min_days, e.max_days);
13400
13655
  return /* @__PURE__ */ g("label", {
13401
13656
  ...Q("delivery-option", q?.id === e.id && "delivery-option-selected"),
13402
13657
  style: {
@@ -13405,7 +13660,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13405
13660
  gap: "10px",
13406
13661
  padding: "12px",
13407
13662
  borderRadius: "8px",
13408
- border: q?.id === e.id ? "1px solid var(--page-accent, #4f46e5)" : Uc,
13663
+ border: q?.id === e.id ? "1px solid var(--page-accent, #4f46e5)" : qc,
13409
13664
  cursor: "pointer"
13410
13665
  },
13411
13666
  children: [
@@ -13468,7 +13723,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13468
13723
  ...Q("section"),
13469
13724
  children: [/* @__PURE__ */ h("h3", {
13470
13725
  ...Q("heading"),
13471
- style: dl,
13726
+ style: hl,
13472
13727
  children: f("address")
13473
13728
  }), /* @__PURE__ */ g("div", {
13474
13729
  ...Q("fields"),
@@ -13477,7 +13732,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13477
13732
  gap: "12px"
13478
13733
  },
13479
13734
  children: [
13480
- /* @__PURE__ */ h(fl, {
13735
+ /* @__PURE__ */ h(gl, {
13481
13736
  label: f("line1"),
13482
13737
  required: !0,
13483
13738
  children: /* @__PURE__ */ h("input", {
@@ -13488,7 +13743,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13488
13743
  autoComplete: "address-line1"
13489
13744
  })
13490
13745
  }),
13491
- /* @__PURE__ */ h(fl, {
13746
+ /* @__PURE__ */ h(gl, {
13492
13747
  label: f("line2"),
13493
13748
  children: /* @__PURE__ */ h("input", {
13494
13749
  ...Q("input"),
@@ -13505,7 +13760,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13505
13760
  gridTemplateColumns: "1fr 1fr",
13506
13761
  gap: "12px"
13507
13762
  },
13508
- children: [/* @__PURE__ */ h(fl, {
13763
+ children: [/* @__PURE__ */ h(gl, {
13509
13764
  label: f("city"),
13510
13765
  required: !0,
13511
13766
  children: /* @__PURE__ */ h("input", {
@@ -13515,7 +13770,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13515
13770
  onChange: L("city"),
13516
13771
  autoComplete: "address-level2"
13517
13772
  })
13518
- }), /* @__PURE__ */ h(fl, {
13773
+ }), /* @__PURE__ */ h(gl, {
13519
13774
  label: f("region"),
13520
13775
  children: /* @__PURE__ */ h("input", {
13521
13776
  ...Q("input"),
@@ -13526,7 +13781,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13526
13781
  })
13527
13782
  })]
13528
13783
  }),
13529
- /* @__PURE__ */ h(fl, {
13784
+ /* @__PURE__ */ h(gl, {
13530
13785
  label: f("note"),
13531
13786
  children: /* @__PURE__ */ h("textarea", {
13532
13787
  rows: 2,
@@ -13581,7 +13836,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13581
13836
  display: "grid",
13582
13837
  gap: "12px"
13583
13838
  },
13584
- children: [H && !ee && /* @__PURE__ */ h(fl, {
13839
+ children: [H && !ee && /* @__PURE__ */ h(gl, {
13585
13840
  label: f("giftRecipient"),
13586
13841
  children: /* @__PURE__ */ h("input", {
13587
13842
  ...Q("input"),
@@ -13591,7 +13846,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13591
13846
  maxLength: 200,
13592
13847
  autoComplete: "off"
13593
13848
  })
13594
- }), /* @__PURE__ */ h(fl, {
13849
+ }), /* @__PURE__ */ h(gl, {
13595
13850
  label: f("giftMessage"),
13596
13851
  children: /* @__PURE__ */ h("textarea", {
13597
13852
  rows: 3,
@@ -13612,7 +13867,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13612
13867
  children: [
13613
13868
  /* @__PURE__ */ h("h3", {
13614
13869
  ...Q("heading"),
13615
- style: dl,
13870
+ style: hl,
13616
13871
  children: f("payment")
13617
13872
  }),
13618
13873
  !re.length && !r && /* @__PURE__ */ h("p", {
@@ -13637,7 +13892,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13637
13892
  gap: "10px",
13638
13893
  padding: "12px",
13639
13894
  borderRadius: "8px",
13640
- border: Uc,
13895
+ border: qc,
13641
13896
  cursor: "pointer"
13642
13897
  },
13643
13898
  children: [/* @__PURE__ */ h("input", {
@@ -13664,13 +13919,13 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13664
13919
  gap: "14px",
13665
13920
  padding: "20px",
13666
13921
  borderRadius: "12px",
13667
- background: Wc
13922
+ background: Jc
13668
13923
  },
13669
13924
  children: [
13670
13925
  /* @__PURE__ */ h("h3", {
13671
13926
  ...Q("summary-title"),
13672
13927
  style: {
13673
- ...dl,
13928
+ ...hl,
13674
13929
  margin: 0
13675
13930
  },
13676
13931
  children: f("cart")
@@ -13733,13 +13988,13 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13733
13988
  gap: "8px",
13734
13989
  marginTop: "4px"
13735
13990
  },
13736
- children: [/* @__PURE__ */ h(Xc, {
13991
+ children: [/* @__PURE__ */ h(el, {
13737
13992
  value: e.quantity,
13738
13993
  label: f("quantity"),
13739
- onCommit: (t) => !r && m.setLine(e.product_id, e.variant_id, t).catch((e) => O(pc(f, e)))
13994
+ onCommit: (t) => !r && m.setLine(e.product_id, e.variant_id, t).catch((e) => O(_c(f, e)))
13740
13995
  }), /* @__PURE__ */ h("button", {
13741
13996
  type: "button",
13742
- onClick: () => !r && m.setLine(e.product_id, e.variant_id, 0).catch((e) => O(pc(f, e))),
13997
+ onClick: () => !r && m.setLine(e.product_id, e.variant_id, 0).catch((e) => O(_c(f, e))),
13743
13998
  ...Q("remove-button"),
13744
13999
  style: {
13745
14000
  background: "none",
@@ -13789,7 +14044,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13789
14044
  style: {
13790
14045
  padding: "4px 10px",
13791
14046
  borderRadius: "999px",
13792
- border: Uc,
14047
+ border: qc,
13793
14048
  fontWeight: 600,
13794
14049
  letterSpacing: "0.04em"
13795
14050
  },
@@ -13837,7 +14092,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13837
14092
  onClick: () => z(j.trim()),
13838
14093
  ...Q("coupon-button"),
13839
14094
  style: {
13840
- ...Kc,
14095
+ ...Xc,
13841
14096
  padding: "8px 14px"
13842
14097
  },
13843
14098
  children: f("apply")
@@ -13854,7 +14109,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13854
14109
  /* @__PURE__ */ g("div", {
13855
14110
  ...Q("totals"),
13856
14111
  style: {
13857
- borderTop: Uc,
14112
+ borderTop: qc,
13858
14113
  paddingTop: "12px",
13859
14114
  display: "grid",
13860
14115
  gap: "6px",
@@ -13969,13 +14224,13 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13969
14224
  ...Q("submit-button"),
13970
14225
  disabled: T || !C || _.shipping_available === !1,
13971
14226
  style: {
13972
- ...Gc,
14227
+ ...Yc,
13973
14228
  width: "100%",
13974
14229
  padding: "12px"
13975
14230
  },
13976
14231
  children: f(T ? "placing" : "placeOrder")
13977
14232
  }),
13978
- /* @__PURE__ */ h(_l, {
14233
+ /* @__PURE__ */ h(xl, {
13979
14234
  apiUrl: c,
13980
14235
  tenant: o,
13981
14236
  words: f,
@@ -13987,7 +14242,7 @@ function hl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
13987
14242
  })]
13988
14243
  });
13989
14244
  }
13990
- var gl = [
14245
+ var bl = [
13991
14246
  "refund",
13992
14247
  "privacy",
13993
14248
  "terms",
@@ -13998,12 +14253,12 @@ var gl = [
13998
14253
  fields: {},
13999
14254
  updated_at: null
14000
14255
  }));
14001
- function _l({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a }) {
14002
- let [o, c] = d(i ? gl : []), [l, u] = d(null);
14256
+ function xl({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a }) {
14257
+ let [o, c] = d(i ? bl : []), [l, u] = d(null);
14003
14258
  if (s(() => {
14004
14259
  if (i) return;
14005
14260
  let n = !0;
14006
- return hc(e, t).then((e) => n && c(e)), () => {
14261
+ return yc(e, t).then((e) => n && c(e)), () => {
14007
14262
  n = !1;
14008
14263
  };
14009
14264
  }, [
@@ -14046,12 +14301,12 @@ function _l({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a })
14046
14301
  display: "flex",
14047
14302
  flexWrap: "wrap",
14048
14303
  gap: "6px 14px",
14049
- borderTop: Uc,
14304
+ borderTop: qc,
14050
14305
  paddingTop: "10px"
14051
14306
  },
14052
14307
  children: o.map(m)
14053
14308
  }),
14054
- l && /* @__PURE__ */ h(vl, {
14309
+ l && /* @__PURE__ */ h(Sl, {
14055
14310
  policy: l,
14056
14311
  words: n,
14057
14312
  locale: r,
@@ -14060,7 +14315,7 @@ function _l({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a })
14060
14315
  ]
14061
14316
  });
14062
14317
  }
14063
- function vl({ policy: e, words: t, locale: n, onClose: r }) {
14318
+ function Sl({ policy: e, words: t, locale: n, onClose: r }) {
14064
14319
  s(() => {
14065
14320
  let e = (e) => {
14066
14321
  e.key === "Escape" && r();
@@ -14098,7 +14353,7 @@ function vl({ policy: e, words: t, locale: n, onClose: r }) {
14098
14353
  style: {
14099
14354
  background: "var(--page-bg, #fff)",
14100
14355
  color: "var(--page-text, #111827)",
14101
- border: Uc,
14356
+ border: qc,
14102
14357
  borderRadius: "12px",
14103
14358
  width: "min(720px, 100%)",
14104
14359
  maxHeight: "85vh",
@@ -14113,7 +14368,7 @@ function vl({ policy: e, words: t, locale: n, onClose: r }) {
14113
14368
  alignItems: "center",
14114
14369
  gap: "12px",
14115
14370
  padding: "16px 20px",
14116
- borderBottom: Uc
14371
+ borderBottom: qc
14117
14372
  },
14118
14373
  children: [/* @__PURE__ */ h("strong", {
14119
14374
  ...Q("modal-title"),
@@ -14128,7 +14383,7 @@ function vl({ policy: e, words: t, locale: n, onClose: r }) {
14128
14383
  "aria-label": t("close"),
14129
14384
  ...Q("modal-close"),
14130
14385
  style: {
14131
- ...Kc,
14386
+ ...Xc,
14132
14387
  padding: "4px 10px"
14133
14388
  },
14134
14389
  children: "×"
@@ -14182,12 +14437,12 @@ function vl({ policy: e, words: t, locale: n, onClose: r }) {
14182
14437
  })
14183
14438
  });
14184
14439
  }
14185
- var yl = {
14440
+ var Cl = {
14186
14441
  year: "numeric",
14187
14442
  month: "short",
14188
14443
  day: "numeric"
14189
14444
  };
14190
- function bl({ reference: e, words: t }) {
14445
+ function wl({ reference: e, words: t }) {
14191
14446
  let [n, r] = d(!1);
14192
14447
  if (!e) return null;
14193
14448
  let i = () => {
@@ -14235,7 +14490,7 @@ function bl({ reference: e, words: t }) {
14235
14490
  onClick: i,
14236
14491
  ...Q("copy-button"),
14237
14492
  style: {
14238
- ...Kc,
14493
+ ...Xc,
14239
14494
  padding: "6px 12px"
14240
14495
  },
14241
14496
  children: t(n ? "copied" : "copy")
@@ -14252,7 +14507,7 @@ function bl({ reference: e, words: t }) {
14252
14507
  ]
14253
14508
  });
14254
14509
  }
14255
- function xl({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
14510
+ function Tl({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
14256
14511
  let a = Array.isArray(e) ? e.filter((e) => e && e.token && !e.revoked_at) : [];
14257
14512
  if (!a.length) return null;
14258
14513
  let o = (e) => {
@@ -14282,7 +14537,7 @@ function xl({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
14282
14537
  alignItems: "center",
14283
14538
  gap: "12px",
14284
14539
  padding: "10px 12px",
14285
- border: Uc,
14540
+ border: qc,
14286
14541
  borderRadius: "8px"
14287
14542
  },
14288
14543
  children: [/* @__PURE__ */ g("div", {
@@ -14312,7 +14567,7 @@ function xl({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
14312
14567
  onClick: i ? (e) => e.preventDefault() : void 0,
14313
14568
  ...Q("download-button"),
14314
14569
  style: {
14315
- ...Gc,
14570
+ ...Yc,
14316
14571
  padding: "6px 14px",
14317
14572
  textDecoration: "none",
14318
14573
  fontSize: "14px"
@@ -14330,7 +14585,7 @@ function xl({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
14330
14585
  })]
14331
14586
  });
14332
14587
  }
14333
- function Sl({ tracking: e, words: t, noNavigate: n }) {
14588
+ function El({ tracking: e, words: t, noNavigate: n }) {
14334
14589
  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 : "";
14335
14590
  return !r && !i && !a ? null : /* @__PURE__ */ g("div", {
14336
14591
  ...Q("tracking"),
@@ -14365,12 +14620,12 @@ function Sl({ tracking: e, words: t, noNavigate: n }) {
14365
14620
  ]
14366
14621
  });
14367
14622
  }
14368
- function Cl({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, inert: i = !1, sample: a = !1, noNavigate: o = !1 }) {
14369
- let { tenant: c, apiUrl: l, locale: u, words: f, orderId: p } = qc(), [m, _] = d(null), [v, y] = d(!1), [b, x] = d("");
14623
+ function Dl({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, inert: i = !1, sample: a = !1, noNavigate: o = !1 }) {
14624
+ let { tenant: c, apiUrl: l, locale: u, words: f, orderId: p } = Zc(), [m, _] = d(null), [v, y] = d(!1), [b, x] = d("");
14370
14625
  s(() => {
14371
14626
  if (i) return;
14372
14627
  let e = !0;
14373
- return rc(l, c, `/store/my/orders?limit=${Math.max(1, Math.min(100, Number(t) || 20))}`).then((t) => e && _(Array.isArray(t?.data) ? t.data : [])).catch((t) => {
14628
+ return sc(l, c, `/store/my/orders?limit=${Math.max(1, Math.min(100, Number(t) || 20))}`).then((t) => e && _(Array.isArray(t?.data) ? t.data : [])).catch((t) => {
14374
14629
  e && (y(t?.code === "LOGIN_REQUIRED"), _([]));
14375
14630
  }), () => {
14376
14631
  e = !1;
@@ -14401,7 +14656,7 @@ function Cl({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
14401
14656
  items: []
14402
14657
  }] : m ?? [], C = (e) => {
14403
14658
  try {
14404
- return new Intl.DateTimeFormat(u || void 0, yl).format(new Date(e));
14659
+ return new Intl.DateTimeFormat(u || void 0, Cl).format(new Date(e));
14405
14660
  } catch {
14406
14661
  return String(e).slice(0, 10);
14407
14662
  }
@@ -14444,7 +14699,7 @@ function Cl({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
14444
14699
  S.map((e) => /* @__PURE__ */ g("div", {
14445
14700
  ...Q("order", b === e.id && "order-open"),
14446
14701
  style: {
14447
- border: Uc,
14702
+ border: qc,
14448
14703
  borderRadius: "10px",
14449
14704
  overflow: "hidden"
14450
14705
  },
@@ -14485,13 +14740,13 @@ function Cl({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
14485
14740
  fontSize: "13px",
14486
14741
  padding: "2px 10px",
14487
14742
  borderRadius: "999px",
14488
- background: Wc
14743
+ background: Jc
14489
14744
  },
14490
14745
  children: [f(`st_${e.status}`), e.payment_status === "paid" ? "" : ` · ${f(`pay_${e.payment_status}`)}`]
14491
14746
  }),
14492
14747
  /* @__PURE__ */ h("strong", {
14493
14748
  ...Q("order-total"),
14494
- children: uc(e.total, e.currency, u)
14749
+ children: mc(e.total, e.currency, u)
14495
14750
  })
14496
14751
  ]
14497
14752
  }), b === e.id && e.items?.length > 0 && /* @__PURE__ */ g("div", {
@@ -14521,19 +14776,19 @@ function Cl({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
14521
14776
  })
14522
14777
  ] }), /* @__PURE__ */ h("span", {
14523
14778
  ...Q("order-item-price"),
14524
- children: uc(t.total, e.currency, u)
14779
+ children: mc(t.total, e.currency, u)
14525
14780
  })]
14526
14781
  }, t.id)),
14527
- e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ h(bl, {
14782
+ e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ h(wl, {
14528
14783
  reference: e.transfer_reference,
14529
14784
  words: f
14530
14785
  }),
14531
- /* @__PURE__ */ h(Sl, {
14786
+ /* @__PURE__ */ h(El, {
14532
14787
  tracking: e.tracking,
14533
14788
  words: f,
14534
14789
  noNavigate: o
14535
14790
  }),
14536
- /* @__PURE__ */ h(xl, {
14791
+ /* @__PURE__ */ h(Tl, {
14537
14792
  downloads: e.downloads,
14538
14793
  apiUrl: l,
14539
14794
  words: f,
@@ -14548,21 +14803,21 @@ function Cl({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
14548
14803
  }
14549
14804
  //#endregion
14550
14805
  //#region ../ui/src/components/builder/apps/language/views.jsx
14551
- function wl(e) {
14806
+ function Ol(e) {
14552
14807
  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());
14553
14808
  return [...new Set(n.map((e) => e.trim()))];
14554
14809
  }
14555
- var Tl = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
14556
- function El(e, t) {
14810
+ var kl = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
14811
+ function Al(e, t) {
14557
14812
  let n = String(e ?? "").toUpperCase();
14558
14813
  if (t === "code") return n;
14559
14814
  let r = "";
14560
14815
  try {
14561
- r = Tl(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
14816
+ r = kl(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
14562
14817
  } catch {}
14563
14818
  return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
14564
14819
  }
14565
- function Dl(e, t) {
14820
+ function jl(e, t) {
14566
14821
  let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
14567
14822
  if (typeof window > "u") return n || "?";
14568
14823
  try {
@@ -14572,8 +14827,8 @@ function Dl(e, t) {
14572
14827
  return n || "/";
14573
14828
  }
14574
14829
  }
14575
- function Ol({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: s, inert: c }) {
14576
- let l = o(Z), u = wl(l?.settings), d = u[0] ?? "", f = u.includes(l?.locale) ? l.locale : d, p = {
14830
+ function Ml({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: s, inert: c }) {
14831
+ let l = o(Z), u = Ol(l?.settings), d = u[0] ?? "", f = u.includes(l?.locale) ? l.locale : d, p = {
14577
14832
  display: "inline-flex",
14578
14833
  alignItems: "center",
14579
14834
  gap: 8,
@@ -14611,7 +14866,7 @@ function Ol({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
14611
14866
  children: n ?? "·"
14612
14867
  }), /* @__PURE__ */ h("a", {
14613
14868
  ...Q("link", e === f && "link-current"),
14614
- href: Dl(e, e === d),
14869
+ href: jl(e, e === d),
14615
14870
  hrefLang: e,
14616
14871
  "aria-current": e === f ? "true" : void 0,
14617
14872
  onClick: c ? (e) => e.preventDefault() : void 0,
@@ -14621,7 +14876,7 @@ function Ol({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
14621
14876
  textDecoration: "none",
14622
14877
  cursor: c ? "default" : "pointer"
14623
14878
  },
14624
- children: El(e, t)
14879
+ children: Al(e, t)
14625
14880
  })]
14626
14881
  }, e))]
14627
14882
  }) : /* @__PURE__ */ g("div", {
@@ -14633,7 +14888,7 @@ function Ol({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
14633
14888
  value: f,
14634
14889
  onChange: c ? void 0 : (e) => {
14635
14890
  let t = e.target.value;
14636
- window.location.assign(Dl(t, t === d));
14891
+ window.location.assign(jl(t, t === d));
14637
14892
  },
14638
14893
  onKeyDown: c ? (e) => e.preventDefault() : void 0,
14639
14894
  style: {
@@ -14649,56 +14904,56 @@ function Ol({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
14649
14904
  ...Q("option", e === f && "option-current"),
14650
14905
  key: e,
14651
14906
  value: e
14652
- }, El(e, t)))
14907
+ }, Al(e, t)))
14653
14908
  })]
14654
14909
  });
14655
14910
  }
14656
14911
  //#endregion
14657
14912
  //#region ../ui/src/components/builder/apps/index.js
14658
- var kl = [
14659
- Ts,
14660
- Ws,
14661
- Ls,
14662
- Gs,
14663
- bs,
14664
- Zs
14665
- ], Al = {
14666
- SiteLoginForm: Fs,
14667
- SiteAccountMenu: Is,
14668
- SiteLanguagePicker: Ol,
14669
- CookieConsent: Us,
14670
- SiteSearch: Xs,
14671
- AccessibilityToolbar: ws,
14672
- ShopProductGrid: rl,
14673
- ShopProduct: il,
14674
- ShopCartButton: sl,
14675
- ShopCheckout: hl,
14676
- ShopOrderHistory: Cl,
14677
- ShopCurrencyPicker: ll,
14678
- ShopFavorites: al
14913
+ var Nl = [
14914
+ ks,
14915
+ Js,
14916
+ Vs,
14917
+ Ys,
14918
+ ws,
14919
+ tc
14920
+ ], Pl = {
14921
+ SiteLoginForm: zs,
14922
+ SiteAccountMenu: Bs,
14923
+ SiteLanguagePicker: Ml,
14924
+ CookieConsent: qs,
14925
+ SiteSearch: ec,
14926
+ AccessibilityToolbar: Os,
14927
+ ShopProductGrid: sl,
14928
+ ShopProduct: cl,
14929
+ ShopCartButton: dl,
14930
+ ShopCheckout: yl,
14931
+ ShopOrderHistory: Dl,
14932
+ ShopCurrencyPicker: pl,
14933
+ ShopFavorites: ll
14679
14934
  };
14680
- new Set(kl.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
14935
+ new Set(Nl.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
14681
14936
  //#endregion
14682
14937
  //#region ../ui/src/components/builder/three/runtime.js
14683
- var jl = "0.185.1", Ml = "4.2.0", Nl = "https://cdn.jsdelivr.net/npm", Pl = `${Nl}/three@${jl}/+esm`, Fl = `${Nl}/@google/model-viewer@${Ml}/dist/model-viewer.min.js`, Il = (e) => import(
14938
+ var Fl = "0.185.1", Il = "4.2.0", Ll = "https://cdn.jsdelivr.net/npm", Rl = `${Ll}/three@${Fl}/+esm`, zl = `${Ll}/@google/model-viewer@${Il}/dist/model-viewer.min.js`, Bl = (e) => import(
14684
14939
  /* @vite-ignore */
14685
14940
  /* webpackIgnore: true */
14686
14941
  e
14687
- ), Ll = /* @__PURE__ */ new Map();
14688
- function Rl(e) {
14689
- if (Ll.has(e)) return Ll.get(e);
14942
+ ), Vl = /* @__PURE__ */ new Map();
14943
+ function Hl(e) {
14944
+ if (Vl.has(e)) return Vl.get(e);
14690
14945
  if (typeof window > "u") return new Promise(() => {});
14691
- let t = Il(e).catch((t) => {
14692
- throw Ll.delete(e), t;
14946
+ let t = Bl(e).catch((t) => {
14947
+ throw Vl.delete(e), t;
14693
14948
  });
14694
- return Ll.set(e, t), t;
14949
+ return Vl.set(e, t), t;
14695
14950
  }
14696
- var zl = () => Rl(Pl), Bl = (e) => Rl(`${Nl}/three@${jl}/examples/jsm/${e}/+esm`);
14697
- function Vl() {
14698
- return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Rl(Fl);
14951
+ var Ul = () => Hl(Rl), Wl = (e) => Hl(`${Ll}/three@${Fl}/examples/jsm/${e}/+esm`);
14952
+ function Gl() {
14953
+ return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Hl(zl);
14699
14954
  }
14700
- var Hl = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Ul = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
14701
- function Wl(e, t) {
14955
+ var Kl = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, ql = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
14956
+ function Jl(e, t) {
14702
14957
  let n = 0, r = 0, i = 0, a = !0, o = (e) => {
14703
14958
  n = requestAnimationFrame(o), i ||= e;
14704
14959
  let a = r ? (e - r) / 1e3 : 0;
@@ -14717,7 +14972,7 @@ function Wl(e, t) {
14717
14972
  s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
14718
14973
  };
14719
14974
  }
14720
- function Gl(e, t, n = {}) {
14975
+ function Yl(e, t, n = {}) {
14721
14976
  let r = {
14722
14977
  radius: n.distance ?? 4,
14723
14978
  polar: n.polar ?? Math.PI / 2.4,
@@ -14766,13 +15021,13 @@ function Gl(e, t, n = {}) {
14766
15021
  }
14767
15022
  //#endregion
14768
15023
  //#region ../ui/src/components/builder/three/views.jsx
14769
- var Kl = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, ql = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, Jl = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, Yl = (e) => typeof e == "string" && !!e.trim();
14770
- function Xl({ label: e, note: t, height: n, nodeRef: r, style: i }) {
15024
+ var Xl = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Zl = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, Ql = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, $l = (e) => typeof e == "string" && !!e.trim();
15025
+ function eu({ label: e, note: t, height: n, nodeRef: r, style: i }) {
14771
15026
  return /* @__PURE__ */ g("div", {
14772
15027
  ref: r,
14773
15028
  style: {
14774
15029
  ...Y(i),
14775
- minHeight: Kl(n, 320),
15030
+ minHeight: Xl(n, 320),
14776
15031
  display: "flex",
14777
15032
  flexDirection: "column",
14778
15033
  alignItems: "center",
@@ -14800,24 +15055,24 @@ function Xl({ label: e, note: t, height: n, nodeRef: r, style: i }) {
14800
15055
  }) : null]
14801
15056
  });
14802
15057
  }
14803
- function Zl({ 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 }) {
15058
+ function tu({ 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 }) {
14804
15059
  let [y, b] = d(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = d(!1);
14805
15060
  s(() => {
14806
15061
  if (y || !e) return;
14807
15062
  let t = !0;
14808
- return Vl().then(() => t && b(!0), () => t && S(!0)), () => {
15063
+ return Gl().then(() => t && b(!0), () => t && S(!0)), () => {
14809
15064
  t = !1;
14810
15065
  };
14811
15066
  }, [y, e]);
14812
15067
  let C = {
14813
15068
  display: "block",
14814
15069
  width: "100%",
14815
- minHeight: Kl(r, 360),
14816
- height: Kl(r, 360),
15070
+ minHeight: Xl(r, 360),
15071
+ height: Xl(r, 360),
14817
15072
  backgroundColor: i || "transparent",
14818
15073
  ...Y(g)
14819
15074
  };
14820
- if (!e) return v ? /* @__PURE__ */ h(Xl, {
15075
+ if (!e) return v ? /* @__PURE__ */ h(eu, {
14821
15076
  nodeRef: _,
14822
15077
  style: g,
14823
15078
  height: r,
@@ -14852,13 +15107,13 @@ function Zl({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotate
14852
15107
  poster: t || void 0,
14853
15108
  style: C,
14854
15109
  "camera-controls": w(!v && c !== !1),
14855
- "auto-rotate": w(T && !Hl()),
14856
- "auto-rotate-delay": T ? String(Kl(o, 0)) : void 0,
15110
+ "auto-rotate": w(T && !Kl()),
15111
+ "auto-rotate-delay": T ? String(Xl(o, 0)) : void 0,
14857
15112
  "rotation-per-second": "18deg",
14858
15113
  ar: w(!v && l === !0),
14859
15114
  "ar-modes": "webxr scene-viewer quick-look",
14860
- "shadow-intensity": String(ql(f, 100)),
14861
- exposure: String(ql(u, 100)),
15115
+ "shadow-intensity": String(Zl(f, 100)),
15116
+ exposure: String(Zl(u, 100)),
14862
15117
  "field-of-view": p ? `${Number(p)}deg` : void 0,
14863
15118
  "environment-image": m && m !== "neutral" ? m : "neutral",
14864
15119
  "interaction-prompt": v ? "none" : void 0,
@@ -14876,7 +15131,7 @@ function Zl({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotate
14876
15131
  }) : null
14877
15132
  });
14878
15133
  }
14879
- var Ql = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), $l = [
15134
+ var nu = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), ru = [
14880
15135
  "precision highp float;",
14881
15136
  "uniform vec2 u_res;",
14882
15137
  "uniform float u_time;",
@@ -14899,7 +15154,7 @@ var Ql = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
14899
15154
  " return v;",
14900
15155
  "}",
14901
15156
  ""
14902
- ].join("\n"), eu = {
15157
+ ].join("\n"), iu = {
14903
15158
  gradient: [
14904
15159
  "void main(){",
14905
15160
  " vec2 uv = gl_FragCoord.xy / u_res;",
@@ -14951,7 +15206,7 @@ var Ql = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
14951
15206
  "}"
14952
15207
  ].join("\n")
14953
15208
  };
14954
- function tu(e, t) {
15209
+ function au(e, t) {
14955
15210
  let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
14956
15211
  if (!n) return t;
14957
15212
  let r = parseInt(n[1], 16);
@@ -14961,7 +15216,7 @@ function tu(e, t) {
14961
15216
  (r & 255) / 255
14962
15217
  ];
14963
15218
  }
14964
- function nu(e, t, n) {
15219
+ function ou(e, t, n) {
14965
15220
  let r = e.createShader(t);
14966
15221
  if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
14967
15222
  let t = e.getShaderInfoLog(r);
@@ -14969,13 +15224,13 @@ function nu(e, t, n) {
14969
15224
  }
14970
15225
  return r;
14971
15226
  }
14972
- function ru({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, scale: o, height: c, interactive: l, style: f, nodeRef: p, inert: m }) {
15227
+ function su({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, scale: o, height: c, interactive: l, style: f, nodeRef: p, inert: m }) {
14973
15228
  let _ = u(null), v = u(null), y = u(null), [b, x] = d("");
14974
15229
  s(() => () => {
14975
15230
  let e = y.current;
14976
15231
  y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
14977
15232
  }, []);
14978
- let S = typeof t == "string" && t.trim() ? t : eu[e] ?? eu.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = ql(a, 100), D = Math.max(.05, ql(o, 100));
15233
+ let S = typeof t == "string" && t.trim() ? t : iu[e] ?? iu.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = Zl(a, 100), D = Math.max(.05, Zl(o, 100));
14979
15234
  return s(() => {
14980
15235
  let e = _.current, t = v.current;
14981
15236
  if (!e || !t) return;
@@ -14990,7 +15245,7 @@ function ru({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
14990
15245
  }
14991
15246
  let r = null;
14992
15247
  try {
14993
- let e = nu(n, n.VERTEX_SHADER, Ql), t = nu(n, n.FRAGMENT_SHADER, $l + S);
15248
+ let e = ou(n, n.VERTEX_SHADER, nu), t = ou(n, n.FRAGMENT_SHADER, ru + S);
14994
15249
  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");
14995
15250
  x("");
14996
15251
  } catch (e) {
@@ -15026,28 +15281,28 @@ function ru({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
15026
15281
  };
15027
15282
  l !== !1 && t.addEventListener("pointermove", u);
15028
15283
  let d = () => {
15029
- let r = Ul(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
15284
+ let r = ql(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
15030
15285
  (e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
15031
15286
  }, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
15032
15287
  f?.observe(t), d();
15033
- let p = Hl(), m = {
15034
- a: tu(C, [
15288
+ let p = Kl(), m = {
15289
+ a: au(C, [
15035
15290
  .35,
15036
15291
  .4,
15037
15292
  .95
15038
15293
  ]),
15039
- b: tu(w, [
15294
+ b: au(w, [
15040
15295
  .05,
15041
15296
  .06,
15042
15297
  .16
15043
15298
  ]),
15044
- c: tu(T, [
15299
+ c: au(T, [
15045
15300
  .95,
15046
15301
  .35,
15047
15302
  .6
15048
15303
  ])
15049
15304
  }, h = {};
15050
- return h.stop = Wl(t, (t, r) => {
15305
+ return h.stop = Jl(t, (t, r) => {
15051
15306
  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?.();
15052
15307
  }), () => {
15053
15308
  h.stop?.(), f?.disconnect(), t.removeEventListener("pointermove", u), n.deleteProgram(r), n.deleteBuffer(i);
@@ -15066,7 +15321,7 @@ function ru({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
15066
15321
  },
15067
15322
  style: {
15068
15323
  position: "relative",
15069
- minHeight: Kl(c, 320),
15324
+ minHeight: Xl(c, 320),
15070
15325
  overflow: "hidden",
15071
15326
  ...Y(f)
15072
15327
  },
@@ -15098,7 +15353,7 @@ function ru({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
15098
15353
  }) : null]
15099
15354
  });
15100
15355
  }
15101
- function iu(e, t) {
15356
+ function cu(e, t) {
15102
15357
  let n = new e.Scene(), r = new e.BoxGeometry();
15103
15358
  r.deleteAttribute("uv");
15104
15359
  let i = new e.Mesh(r, new e.MeshBasicMaterial({
@@ -15114,23 +15369,23 @@ function iu(e, t) {
15114
15369
  let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
15115
15370
  return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
15116
15371
  }
15117
- var au = /* @__PURE__ */ new Map();
15118
- function ou(e) {
15119
- if (au.has(e)) return au.get(e);
15120
- let t = Bl("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
15372
+ var lu = /* @__PURE__ */ new Map();
15373
+ function uu(e) {
15374
+ if (lu.has(e)) return lu.get(e);
15375
+ let t = Wl("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
15121
15376
  new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
15122
15377
  })).catch((t) => {
15123
- throw au.delete(e), t;
15378
+ throw lu.delete(e), t;
15124
15379
  });
15125
- return au.set(e, t), t;
15380
+ return lu.set(e, t), t;
15126
15381
  }
15127
- function su(e, t) {
15382
+ function du(e, t) {
15128
15383
  let n = new e.Box3().setFromObject(t);
15129
15384
  if (n.isEmpty()) return t;
15130
15385
  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();
15131
15386
  return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
15132
15387
  }
15133
- var cu = {
15388
+ var fu = {
15134
15389
  box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
15135
15390
  sphere: (e) => new e.SphereGeometry(.62, 48, 32),
15136
15391
  torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
@@ -15139,50 +15394,50 @@ var cu = {
15139
15394
  cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
15140
15395
  plane: (e) => new e.PlaneGeometry(1.4, 1.4),
15141
15396
  capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
15142
- }, lu = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
15143
- function uu({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: a, controls: o, ground: c, height: l, style: f, nodeRef: p, inert: m }) {
15144
- 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 && !Hl(), S = o !== !1 && !m;
15397
+ }, pu = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
15398
+ function mu({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: a, controls: o, ground: c, height: l, style: f, nodeRef: p, inert: m }) {
15399
+ 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 && !Kl(), S = o !== !1 && !m;
15145
15400
  return s(() => {
15146
15401
  let e = g.current;
15147
15402
  if (!e) return;
15148
15403
  let i = !0, o = null;
15149
- return zl().then((s) => {
15404
+ return Ul().then((s) => {
15150
15405
  if (!i || !e) return;
15151
15406
  let l = new s.WebGLRenderer({
15152
15407
  antialias: !0,
15153
15408
  alpha: !t
15154
15409
  });
15155
- l.setPixelRatio(Ul()), 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);
15410
+ l.setPixelRatio(ql()), 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);
15156
15411
  let u = new s.Scene();
15157
- t && (u.background = new s.Color(t)), u.environment = iu(s, l);
15158
- let d = new s.PerspectiveCamera(lu(r, 45), 1, .1, 400), f = Gl(d, l.domElement, {
15159
- distance: lu(n, 5),
15412
+ t && (u.background = new s.Color(t)), u.environment = cu(s, l);
15413
+ let d = new s.PerspectiveCamera(pu(r, 45), 1, .1, 400), f = Yl(d, l.domElement, {
15414
+ distance: pu(n, 5),
15160
15415
  enableZoom: S
15161
15416
  }), p = new s.DirectionalLight(16777215, 2.2);
15162
15417
  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));
15163
15418
  let m = [], h = new s.Group(), g = (e, t) => {
15164
- let n = lu(t.scale, 1);
15165
- e.position.set(lu(t.x, 0), lu(t.y, 0), lu(t.z, 0)), e.rotation.set(Jl(t.rx), Jl(t.ry), Jl(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = Jl(t.spin);
15419
+ let n = pu(t.scale, 1);
15420
+ e.position.set(pu(t.x, 0), pu(t.y, 0), pu(t.z, 0)), e.rotation.set(Ql(t.rx), Ql(t.ry), Ql(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = Ql(t.spin);
15166
15421
  };
15167
15422
  for (let e of y) {
15168
15423
  if (e.shape === "model") {
15169
- if (!Yl(e.src)) continue;
15424
+ if (!$l(e.src)) continue;
15170
15425
  let t = new s.Group();
15171
- g(t, e), h.add(t), ou(e.src).then((e) => {
15426
+ g(t, e), h.add(t), uu(e.src).then((e) => {
15172
15427
  if (!i) return;
15173
- let n = su(s, e.clone(!0));
15428
+ let n = du(s, e.clone(!0));
15174
15429
  n.traverse((e) => {
15175
15430
  e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
15176
15431
  }), t.add(n);
15177
15432
  }, () => {});
15178
15433
  continue;
15179
15434
  }
15180
- let t = (cu[e.shape] ?? cu.box)(s), n = new s.MeshStandardMaterial({
15435
+ let t = (fu[e.shape] ?? fu.box)(s), n = new s.MeshStandardMaterial({
15181
15436
  color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
15182
- metalness: Math.min(1, Math.max(0, ql(e.metalness, 10))),
15183
- roughness: Math.min(1, Math.max(0, ql(e.roughness, 35))),
15184
- transparent: ql(e.opacity, 100) < 1,
15185
- opacity: Math.min(1, Math.max(0, ql(e.opacity, 100))),
15437
+ metalness: Math.min(1, Math.max(0, Zl(e.metalness, 10))),
15438
+ roughness: Math.min(1, Math.max(0, Zl(e.roughness, 35))),
15439
+ transparent: Zl(e.opacity, 100) < 1,
15440
+ opacity: Math.min(1, Math.max(0, Zl(e.opacity, 100))),
15186
15441
  flatShading: e.flat === !0,
15187
15442
  wireframe: e.wireframe === !0,
15188
15443
  side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
@@ -15193,14 +15448,14 @@ function uu({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
15193
15448
  let _ = null;
15194
15449
  if (c !== !1) {
15195
15450
  let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
15196
- _ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = lu(c === !0 ? 0 : c, -.85), _.receiveShadow = !0, u.add(_), m.push(t, e);
15451
+ _ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = pu(c === !0 ? 0 : c, -.85), _.receiveShadow = !0, u.add(_), m.push(t, e);
15197
15452
  }
15198
15453
  let v = () => {
15199
15454
  let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
15200
15455
  l.setSize(t, n, !1), d.aspect = t / n, d.updateProjectionMatrix();
15201
15456
  }, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
15202
15457
  b?.observe(e), v();
15203
- let C = Jl(Number.isFinite(Number(a)) ? a : 20), w = Wl(e, (e) => {
15458
+ let C = Ql(Number.isFinite(Number(a)) ? a : 20), w = Jl(e, (e) => {
15204
15459
  f.autoSpin(x ? C : 0, e), f.update();
15205
15460
  for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
15206
15461
  l.render(u, d);
@@ -15224,7 +15479,7 @@ function uu({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
15224
15479
  a,
15225
15480
  S,
15226
15481
  c
15227
- ]), _ && m ? /* @__PURE__ */ h(Xl, {
15482
+ ]), _ && m ? /* @__PURE__ */ h(eu, {
15228
15483
  nodeRef: p,
15229
15484
  style: f,
15230
15485
  height: l,
@@ -15235,27 +15490,27 @@ function uu({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
15235
15490
  g.current = e, typeof p == "function" && p(e);
15236
15491
  },
15237
15492
  style: {
15238
- minHeight: Kl(l, 380),
15239
- height: Kl(l, 380),
15493
+ minHeight: Xl(l, 380),
15494
+ height: Xl(l, 380),
15240
15495
  overflow: "hidden",
15241
15496
  touchAction: S ? "pan-y" : void 0,
15242
15497
  ...Y(f)
15243
15498
  }
15244
15499
  });
15245
15500
  }
15246
- function du({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a }) {
15501
+ function hu({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a }) {
15247
15502
  let o = u(null), [c, l] = d("");
15248
15503
  return s(() => {
15249
15504
  let t = o.current;
15250
15505
  if (a || !t || typeof e != "string" || !e.trim()) return;
15251
15506
  let r = !0, i = null;
15252
- return zl().then((a) => {
15507
+ return Ul().then((a) => {
15253
15508
  if (!r || !t) return;
15254
15509
  let o = new a.WebGLRenderer({
15255
15510
  antialias: !0,
15256
15511
  alpha: !n
15257
15512
  });
15258
- o.setPixelRatio(Ul()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
15513
+ o.setPixelRatio(ql()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
15259
15514
  let s = new a.Scene();
15260
15515
  n && (s.background = new a.Color(n));
15261
15516
  let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
@@ -15278,7 +15533,7 @@ function du({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
15278
15533
  o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
15279
15534
  }, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
15280
15535
  f?.observe(t), d();
15281
- let p = !1, m = Wl(t, (e, t) => {
15536
+ let p = !1, m = Jl(t, (e, t) => {
15282
15537
  if (!p && typeof u?.frame == "function") try {
15283
15538
  u.frame(e, t);
15284
15539
  } catch (e) {
@@ -15300,7 +15555,7 @@ function du({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
15300
15555
  e,
15301
15556
  a,
15302
15557
  n
15303
- ]), a ? /* @__PURE__ */ h(Xl, {
15558
+ ]), a ? /* @__PURE__ */ h(eu, {
15304
15559
  nodeRef: i,
15305
15560
  style: r,
15306
15561
  height: t,
@@ -15311,8 +15566,8 @@ function du({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
15311
15566
  o.current = e, typeof i == "function" && i(e);
15312
15567
  },
15313
15568
  style: {
15314
- minHeight: Kl(t, 380),
15315
- height: Kl(t, 380),
15569
+ minHeight: Xl(t, 380),
15570
+ height: Xl(t, 380),
15316
15571
  overflow: "hidden",
15317
15572
  position: "relative",
15318
15573
  touchAction: "pan-y",
@@ -15335,30 +15590,30 @@ function du({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
15335
15590
  }) : null
15336
15591
  });
15337
15592
  }
15338
- var fu = {
15339
- ModelViewerBlock: Zl,
15340
- ShaderBlock: ru,
15341
- SceneBlock: uu,
15342
- ThreeCanvasBlock: du
15343
- }, pu = "2.44.0", mu = "https://cdn.jsdelivr.net/npm", hu = `${mu}/@rive-app/canvas@${pu}/+esm`, gu = `${mu}/@rive-app/canvas@${pu}/rive.wasm`, _u = (e) => import(
15593
+ var gu = {
15594
+ ModelViewerBlock: tu,
15595
+ ShaderBlock: su,
15596
+ SceneBlock: mu,
15597
+ ThreeCanvasBlock: hu
15598
+ }, _u = "2.44.0", vu = "https://cdn.jsdelivr.net/npm", yu = `${vu}/@rive-app/canvas@${_u}/+esm`, bu = `${vu}/@rive-app/canvas@${_u}/rive.wasm`, xu = (e) => import(
15344
15599
  /* @vite-ignore */
15345
15600
  /* webpackIgnore: true */
15346
15601
  e
15347
- ), vu = null;
15348
- function yu() {
15349
- return typeof window > "u" ? new Promise(() => {}) : vu || (vu = _u(hu).then((e) => {
15602
+ ), Su = null;
15603
+ function Cu() {
15604
+ return typeof window > "u" ? new Promise(() => {}) : Su || (Su = xu(yu).then((e) => {
15350
15605
  let t = e?.default ?? e;
15351
- return t?.RuntimeLoader?.setWasmUrl && t.RuntimeLoader.setWasmUrl(gu), t;
15606
+ return t?.RuntimeLoader?.setWasmUrl && t.RuntimeLoader.setWasmUrl(bu), t;
15352
15607
  }).catch((e) => {
15353
- throw vu = null, e;
15354
- }), vu);
15608
+ throw Su = null, e;
15609
+ }), Su);
15355
15610
  }
15356
- var bu = /* @__PURE__ */ new Map(), xu = {
15611
+ var wu = /* @__PURE__ */ new Map(), Tu = {
15357
15612
  56: "number",
15358
15613
  58: "trigger",
15359
15614
  59: "boolean"
15360
- }, Su = /* @__PURE__ */ new Set();
15361
- function Cu(e, t) {
15615
+ }, Eu = /* @__PURE__ */ new Set();
15616
+ function Du(e, t) {
15362
15617
  if (!e || !t) return;
15363
15618
  let n = (Array.isArray(t.artboards) ? t.artboards : []).map((e) => ({
15364
15619
  name: String(e?.name ?? ""),
@@ -15367,15 +15622,15 @@ function Cu(e, t) {
15367
15622
  name: String(e?.name ?? ""),
15368
15623
  inputs: (Array.isArray(e?.inputs) ? e.inputs : []).map((e) => ({
15369
15624
  name: String(e?.name ?? ""),
15370
- type: xu[e?.type] ?? "unknown"
15625
+ type: Tu[e?.type] ?? "unknown"
15371
15626
  }))
15372
15627
  }))
15373
15628
  }));
15374
- bu.set(e, { artboards: n }), Su.forEach((t) => t(e));
15629
+ wu.set(e, { artboards: n }), Eu.forEach((t) => t(e));
15375
15630
  }
15376
15631
  //#endregion
15377
15632
  //#region ../ui/src/components/builder/rive/views.jsx
15378
- var wu = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Tu = [
15633
+ var Ou = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, ku = [
15379
15634
  "contain",
15380
15635
  "cover",
15381
15636
  "fill",
@@ -15384,7 +15639,7 @@ var wu = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t,
15384
15639
  "scaleDown",
15385
15640
  "none",
15386
15641
  "layout"
15387
- ], Eu = [
15642
+ ], Au = [
15388
15643
  "center",
15389
15644
  "topLeft",
15390
15645
  "topCenter",
@@ -15394,8 +15649,8 @@ var wu = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t,
15394
15649
  "bottomLeft",
15395
15650
  "bottomCenter",
15396
15651
  "bottomRight"
15397
- ], Du = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Ou = 131;
15398
- function ku(e, t, n, r) {
15652
+ ], ju = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Mu = 131;
15653
+ function Nu(e, t, n, r) {
15399
15654
  if (!e || !t || !n) return;
15400
15655
  let i = [];
15401
15656
  try {
@@ -15406,15 +15661,15 @@ function ku(e, t, n, r) {
15406
15661
  let a = i.find((e) => e?.name === n);
15407
15662
  a && (a.type === 58 ? r && a.fire() : a.type === 59 ? a.value = !!r : a.type === 56 && (a.value = +!!r));
15408
15663
  }
15409
- function Au({ 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 }) {
15664
+ function Pu({ 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 }) {
15410
15665
  let S = u(null), C = u(null), w = u(null), T = u(""), [E, D] = d(!1), [O, k] = d(!1);
15411
15666
  s(() => {
15412
15667
  let t = C.current, n = S.current;
15413
15668
  if (D(!1), k(!1), !e || !t) return;
15414
15669
  let r = !0, i = null, s = null, u = null;
15415
- return yu().then((d) => {
15670
+ return Cu().then((d) => {
15416
15671
  if (!r) return;
15417
- let h = o !== "animation", g = m !== !1 && !Du();
15672
+ let h = o !== "animation", g = m !== !1 && !ju();
15418
15673
  try {
15419
15674
  i = new d.Rive({
15420
15675
  src: e,
@@ -15424,8 +15679,8 @@ function Au({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
15424
15679
  animations: !h && l ? l : void 0,
15425
15680
  autoplay: g,
15426
15681
  layout: new d.Layout({
15427
- fit: Tu.includes(f) ? f : "contain",
15428
- alignment: Eu.includes(p) ? p : "center"
15682
+ fit: ku.includes(f) ? f : "contain",
15683
+ alignment: Au.includes(p) ? p : "center"
15429
15684
  }),
15430
15685
  shouldDisableRiveListeners: !!x,
15431
15686
  isTouchScrollEnabled: !0,
@@ -15433,7 +15688,7 @@ function Au({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
15433
15688
  if (!r) return;
15434
15689
  i.resizeDrawingSurfaceToCanvas();
15435
15690
  let t = i.contents;
15436
- if (Cu(e, t), h) {
15691
+ if (Du(e, t), h) {
15437
15692
  let e = ((t?.artboards ?? []).find((e) => e.name === (a || i.activeArtboard)) ?? t?.artboards?.[0])?.stateMachines?.[0]?.name ?? "";
15438
15693
  if (T.current = c || e, !c && e) try {
15439
15694
  i.play(e), g || i.pause(e);
@@ -15449,7 +15704,7 @@ function Au({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
15449
15704
  }
15450
15705
  w.current = i, n && (n.rive = i), i.on(d.EventType.RiveEvent, (e) => {
15451
15706
  let t = e?.data;
15452
- x || t?.type !== Ou || !t?.url || (t.target === "_self" ? window.location.assign(t.url) : window.open(t.url, t.target || "_blank", "noopener"));
15707
+ x || t?.type !== Mu || !t?.url || (t.target === "_self" ? window.location.assign(t.url) : window.open(t.url, t.target || "_blank", "noopener"));
15453
15708
  }), n && typeof ResizeObserver < "u" && (s = new ResizeObserver(() => i?.resizeDrawingSurfaceToCanvas()), s.observe(n)), n && typeof IntersectionObserver < "u" && (u = new IntersectionObserver(([e]) => {
15454
15709
  i && (e?.isIntersecting ? i.startRendering?.() : i.stopRendering?.());
15455
15710
  }), u.observe(n));
@@ -15470,11 +15725,11 @@ function Au({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
15470
15725
  m,
15471
15726
  x
15472
15727
  ]);
15473
- let A = !x && E, j = (e, t) => A && ku(w.current, T.current, e, t), M = {
15728
+ let A = !x && E, j = (e, t) => A && Nu(w.current, T.current, e, t), M = {
15474
15729
  position: "relative",
15475
15730
  display: "block",
15476
15731
  width: "100%",
15477
- height: wu(r, 360),
15732
+ height: Ou(r, 360),
15478
15733
  backgroundColor: i || "transparent",
15479
15734
  overflow: "hidden",
15480
15735
  ...Y(y)
@@ -15536,27 +15791,27 @@ function Au({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
15536
15791
  }), /* @__PURE__ */ h("span", { children: "Pick a .riv file in the Settings panel." })]
15537
15792
  }) : null;
15538
15793
  }
15539
- var ju = { RiveBlock: Au }, Mu = /\.(mp4|webm|ogv|ogg|mov|m4v)(\?|#|$)/i, Nu = /\.(jpe?g|png|gif|webp|avif|svg|bmp)(\?|#|$)/i, Pu = /\.(pdf|docx?|xlsx?|pptx?|odt|ods|odp|txt|csv|zip|rar|7z|mp3|wav|m4a)(\?|#|$)/i, Fu = /vimeo\.com\/(?:video\/)?(\d+)/i, Iu = "data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20320%20240%22%3E%3Crect%20width%3D%22320%22%20height%3D%22240%22%20fill%3D%22%231e293b%22%2F%3E%3Ccircle%20cx%3D%22160%22%20cy%3D%22120%22%20r%3D%2234%22%20fill%3D%22rgba(255%2C255%2C255%2C0.16)%22%2F%3E%3Cpath%20d%3D%22M150%20102%20L178%20120%20L150%20138%20Z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
15540
- function Lu(e, t = "") {
15794
+ var Fu = { RiveBlock: Pu }, Iu = /\.(mp4|webm|ogv|ogg|mov|m4v)(\?|#|$)/i, Lu = /\.(jpe?g|png|gif|webp|avif|svg|bmp)(\?|#|$)/i, Ru = /\.(pdf|docx?|xlsx?|pptx?|odt|ods|odp|txt|csv|zip|rar|7z|mp3|wav|m4a)(\?|#|$)/i, zu = /vimeo\.com\/(?:video\/)?(\d+)/i, Bu = "data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20320%20240%22%3E%3Crect%20width%3D%22320%22%20height%3D%22240%22%20fill%3D%22%231e293b%22%2F%3E%3Ccircle%20cx%3D%22160%22%20cy%3D%22120%22%20r%3D%2234%22%20fill%3D%22rgba(255%2C255%2C255%2C0.16)%22%2F%3E%3Cpath%20d%3D%22M150%20102%20L178%20120%20L150%20138%20Z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
15795
+ function Vu(e, t = "") {
15541
15796
  let n = String(e ?? "");
15542
- return xi(n) && /youtu/i.test(n) ? "youtube" : Fu.test(n) ? "vimeo" : String(t).startsWith("video/") || Mu.test(n) ? "video" : String(t).startsWith("image/") || Nu.test(n) ? "image" : t || Pu.test(n) ? "document" : "unknown";
15797
+ return xi(n) && /youtu/i.test(n) ? "youtube" : zu.test(n) ? "vimeo" : String(t).startsWith("video/") || Iu.test(n) ? "video" : String(t).startsWith("image/") || Lu.test(n) ? "image" : t || Ru.test(n) ? "document" : "unknown";
15543
15798
  }
15544
- var Ru = /* @__PURE__ */ new Map();
15545
- function zu(e) {
15546
- return Ru.has(e) || Ru.set(e, new Promise((t) => {
15799
+ var Hu = /* @__PURE__ */ new Map();
15800
+ function Uu(e) {
15801
+ return Hu.has(e) || Hu.set(e, new Promise((t) => {
15547
15802
  let n = new Image();
15548
15803
  n.onload = () => t("image"), n.onerror = () => {
15549
15804
  fetch(e, { method: "HEAD" }).then((e) => t(String(e.headers.get("content-type") ?? "").startsWith("video/") ? "video" : "drop")).catch(() => t("drop"));
15550
15805
  }, n.src = e;
15551
- })), Ru.get(e);
15806
+ })), Hu.get(e);
15552
15807
  }
15553
- function Bu(e, t = 0) {
15808
+ function Wu(e, t = 0) {
15554
15809
  let [n, r] = d({}), i = e.filter((e) => e.kind === "unknown" && !(e.src in n)).map((e) => e.src).join("|");
15555
15810
  return s(() => {
15556
15811
  if (!i || typeof window > "u") return;
15557
15812
  let e = !0;
15558
15813
  return i.split("|").forEach((t) => {
15559
- zu(t).then((n) => e && r((e) => ({
15814
+ Uu(t).then((n) => e && r((e) => ({
15560
15815
  ...e,
15561
15816
  [t]: n
15562
15817
  })));
@@ -15569,31 +15824,31 @@ function Bu(e, t = 0) {
15569
15824
  return t === "drop" ? null : {
15570
15825
  ...e,
15571
15826
  kind: t,
15572
- thumb: t === "video" ? Hu(e.src, "video", e.poster) : e.thumb
15827
+ thumb: t === "video" ? Ku(e.src, "video", e.poster) : e.thumb
15573
15828
  };
15574
15829
  }).filter(Boolean).slice(0, Math.max(0, Number(t) || 0) || void 0).map((e, t) => ({
15575
15830
  ...e,
15576
15831
  index: t + 1
15577
15832
  }));
15578
15833
  }
15579
- var Vu = (e) => e === "video" || e === "youtube" || e === "vimeo";
15580
- function Hu(e, t, n) {
15581
- return n || (t === "image" || t === "unknown" ? e : t === "youtube" ? `https://i.ytimg.com/vi/${xi(e)}/hqdefault.jpg` : Iu);
15834
+ var Gu = (e) => e === "video" || e === "youtube" || e === "vimeo";
15835
+ function Ku(e, t, n) {
15836
+ return n || (t === "image" || t === "unknown" ? e : t === "youtube" ? `https://i.ytimg.com/vi/${xi(e)}/hqdefault.jpg` : Bu);
15582
15837
  }
15583
- var Uu = (e) => e == null ? "" : br(e), Wu = (e) => (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? {
15838
+ var qu = (e) => e == null ? "" : br(e), Ju = (e) => (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? {
15584
15839
  url: e.url ?? e.src ?? "",
15585
15840
  mime: e.mime ?? ""
15586
15841
  } : {
15587
15842
  url: e,
15588
15843
  mime: ""
15589
- }).filter((e) => typeof e.url == "string" && e.url.trim()), Gu = (e) => {
15844
+ }).filter((e) => typeof e.url == "string" && e.url.trim()), Yu = (e) => {
15590
15845
  try {
15591
15846
  return decodeURIComponent(String(e).split(/[?#]/)[0].split("/").pop() ?? "");
15592
15847
  } catch {
15593
15848
  return "";
15594
15849
  }
15595
15850
  };
15596
- function Ku({ items: e, entries: t, mediaField: n, nameField: r, posterField: i, limit: a }) {
15851
+ function Xu({ items: e, entries: t, mediaField: n, nameField: r, posterField: i, limit: a }) {
15597
15852
  let o = Math.max(0, Number(a) || 0), s = [], c = (e) => o && s.length >= o ? !1 : (s.push({
15598
15853
  ...e,
15599
15854
  index: s.length + 1
@@ -15601,14 +15856,14 @@ function Ku({ items: e, entries: t, mediaField: n, nameField: r, posterField: i,
15601
15856
  if (Array.isArray(t)) {
15602
15857
  for (let e of t) {
15603
15858
  if (!e || typeof e != "object") continue;
15604
- let t = e.data ?? e, a = Uu(r ? vr(t, r) : t.name), o = i ? Wu(vr(t, i))[0]?.url ?? "" : "";
15605
- for (let { url: r, mime: i } of Wu(vr(t, n))) {
15606
- let t = Lu(r, i);
15859
+ let t = e.data ?? e, a = qu(r ? vr(t, r) : t.name), o = i ? Ju(vr(t, i))[0]?.url ?? "" : "";
15860
+ for (let { url: r, mime: i } of Ju(vr(t, n))) {
15861
+ let t = Vu(r, i);
15607
15862
  if (t !== "document" && !c({
15608
15863
  src: r,
15609
15864
  kind: t,
15610
15865
  poster: o,
15611
- thumb: Hu(r, t, o),
15866
+ thumb: Ku(r, t, o),
15612
15867
  name: a,
15613
15868
  alt: a,
15614
15869
  entry: e
@@ -15619,12 +15874,12 @@ function Ku({ items: e, entries: t, mediaField: n, nameField: r, posterField: i,
15619
15874
  }
15620
15875
  for (let t of Array.isArray(e) ? e : []) {
15621
15876
  if (!t || typeof t != "object" || !t.src) continue;
15622
- let e = Lu(t.src, t.mime), n = t.name || "";
15877
+ let e = Vu(t.src, t.mime), n = t.name || "";
15623
15878
  if (e !== "document" && !c({
15624
15879
  src: t.src,
15625
15880
  kind: e,
15626
15881
  poster: t.poster,
15627
- thumb: Hu(t.src, e, t.poster),
15882
+ thumb: Ku(t.src, e, t.poster),
15628
15883
  name: n,
15629
15884
  alt: t.alt || n,
15630
15885
  entry: null
@@ -15632,7 +15887,7 @@ function Ku({ items: e, entries: t, mediaField: n, nameField: r, posterField: i,
15632
15887
  }
15633
15888
  return s;
15634
15889
  }
15635
- function qu(e) {
15890
+ function Zu(e) {
15636
15891
  let t = e.entry && typeof e.entry == "object" ? e.entry : { id: `item-${e.index}` };
15637
15892
  return {
15638
15893
  ...t,
@@ -15640,13 +15895,13 @@ function qu(e) {
15640
15895
  ...t.data ?? {},
15641
15896
  src: e.src,
15642
15897
  thumb: e.thumb,
15643
- name: e.name || Gu(e.src),
15644
- kind: Vu(e.kind) ? "video" : "image",
15898
+ name: e.name || Yu(e.src),
15899
+ kind: Gu(e.kind) ? "video" : "image",
15645
15900
  index: e.index
15646
15901
  }
15647
15902
  };
15648
15903
  }
15649
- function Ju({ item: e }) {
15904
+ function Qu({ item: e }) {
15650
15905
  return /* @__PURE__ */ g("span", {
15651
15906
  ...Q("tile-media"),
15652
15907
  style: {
@@ -15667,10 +15922,10 @@ function Ju({ item: e }) {
15667
15922
  objectFit: "cover",
15668
15923
  borderRadius: "inherit"
15669
15924
  }
15670
- }), Vu(e.kind) && /* @__PURE__ */ h(Yu, {})]
15925
+ }), Gu(e.kind) && /* @__PURE__ */ h($u, {})]
15671
15926
  });
15672
15927
  }
15673
- function Yu() {
15928
+ function $u() {
15674
15929
  return /* @__PURE__ */ h("span", {
15675
15930
  ...Q("play"),
15676
15931
  "aria-hidden": "true",
@@ -15698,7 +15953,7 @@ function Yu() {
15698
15953
  })
15699
15954
  });
15700
15955
  }
15701
- function Xu({ item: e, autoplay: t }) {
15956
+ function ed({ item: e, autoplay: t }) {
15702
15957
  let n = {
15703
15958
  maxWidth: "92vw",
15704
15959
  maxHeight: "80vh",
@@ -15707,7 +15962,7 @@ function Xu({ item: e, autoplay: t }) {
15707
15962
  display: "block"
15708
15963
  };
15709
15964
  if (e.kind === "youtube" || e.kind === "vimeo") {
15710
- let r = e.kind === "youtube" ? `https://www.youtube-nocookie.com/embed/${xi(e.src)}?rel=0${t ? "&autoplay=1" : ""}` : `https://player.vimeo.com/video/${e.src.match(Fu)?.[1]}${t ? "?autoplay=1" : ""}`;
15965
+ let r = e.kind === "youtube" ? `https://www.youtube-nocookie.com/embed/${xi(e.src)}?rel=0${t ? "&autoplay=1" : ""}` : `https://player.vimeo.com/video/${e.src.match(zu)?.[1]}${t ? "?autoplay=1" : ""}`;
15711
15966
  return /* @__PURE__ */ h("iframe", {
15712
15967
  ...Q("media"),
15713
15968
  src: r,
@@ -15726,7 +15981,7 @@ function Xu({ item: e, autoplay: t }) {
15726
15981
  return e.kind === "video" ? /* @__PURE__ */ h("video", {
15727
15982
  ...Q("media"),
15728
15983
  src: e.src,
15729
- poster: e.thumb === Iu ? void 0 : e.thumb,
15984
+ poster: e.thumb === Bu ? void 0 : e.thumb,
15730
15985
  controls: !0,
15731
15986
  autoPlay: t,
15732
15987
  playsInline: !0,
@@ -15741,7 +15996,7 @@ function Xu({ item: e, autoplay: t }) {
15741
15996
  style: n
15742
15997
  });
15743
15998
  }
15744
- var Zu = {
15999
+ var td = {
15745
16000
  position: "absolute",
15746
16001
  top: "50%",
15747
16002
  transform: "translateY(-50%)",
@@ -15756,7 +16011,7 @@ var Zu = {
15756
16011
  alignItems: "center",
15757
16012
  justifyContent: "center"
15758
16013
  };
15759
- function Qu({ list: e, index: t, onIndex: n, onClose: r, options: i, locale: a }) {
16014
+ function nd({ list: e, index: t, onIndex: n, onClose: r, options: i, locale: a }) {
15760
16015
  let o = wt(a), { loop: c = !0, caption: l = !0, counter: d = !0, thumbs: f = !1, backdrop: p = "", color: _ = "", autoplay: v = !0 } = i, y = e[t], b = u(null), x = e.length, S = c || t > 0, C = c || t < x - 1, w = (e) => n((t) => {
15761
16016
  let n = t + e;
15762
16017
  return c ? (n + x) % x : Math.min(Math.max(n, 0), x - 1);
@@ -15769,7 +16024,7 @@ function Qu({ list: e, index: t, onIndex: n, onClose: r, options: i, locale: a }
15769
16024
  window.removeEventListener("keydown", e), t.style.overflow = n;
15770
16025
  };
15771
16026
  }, [x, c]), !y) return null;
15772
- let T = (e) => e.stopPropagation(), E = y.name || Gu(y.src);
16027
+ let T = (e) => e.stopPropagation(), E = y.name || Yu(y.src);
15773
16028
  return /* @__PURE__ */ g("div", {
15774
16029
  ...Q("backdrop"),
15775
16030
  role: "dialog",
@@ -15798,7 +16053,7 @@ function Qu({ list: e, index: t, onIndex: n, onClose: r, options: i, locale: a }
15798
16053
  alignItems: "center",
15799
16054
  justifyContent: "center"
15800
16055
  },
15801
- children: /* @__PURE__ */ h(Xu, {
16056
+ children: /* @__PURE__ */ h(ed, {
15802
16057
  item: y,
15803
16058
  autoplay: v
15804
16059
  }, t)
@@ -15899,7 +16154,7 @@ function Qu({ list: e, index: t, onIndex: n, onClose: r, options: i, locale: a }
15899
16154
  T(e), w(-1);
15900
16155
  },
15901
16156
  style: {
15902
- ...Zu,
16157
+ ...td,
15903
16158
  left: 16,
15904
16159
  opacity: S ? 1 : .3
15905
16160
  },
@@ -15923,7 +16178,7 @@ function Qu({ list: e, index: t, onIndex: n, onClose: r, options: i, locale: a }
15923
16178
  T(e), w(1);
15924
16179
  },
15925
16180
  style: {
15926
- ...Zu,
16181
+ ...td,
15927
16182
  right: 16,
15928
16183
  opacity: C ? 1 : .3
15929
16184
  },
@@ -15942,11 +16197,11 @@ function Qu({ list: e, index: t, onIndex: n, onClose: r, options: i, locale: a }
15942
16197
  ]
15943
16198
  });
15944
16199
  }
15945
- function $u(e, t, n) {
16200
+ function rd(e, t, n) {
15946
16201
  let [r, i] = d(null);
15947
16202
  return {
15948
16203
  open: i,
15949
- overlay: r !== null && e[r] && typeof document < "u" ? p(/* @__PURE__ */ h(Qu, {
16204
+ overlay: r !== null && e[r] && typeof document < "u" ? p(/* @__PURE__ */ h(nd, {
15950
16205
  list: e,
15951
16206
  index: r,
15952
16207
  onIndex: i,
@@ -15956,7 +16211,7 @@ function $u(e, t, n) {
15956
16211
  }), document.body) : null
15957
16212
  };
15958
16213
  }
15959
- function ed(e, t, n) {
16214
+ function id(e, t, n) {
15960
16215
  return {
15961
16216
  role: "button",
15962
16217
  tabIndex: 0,
@@ -15969,7 +16224,7 @@ function ed(e, t, n) {
15969
16224
  }
15970
16225
  };
15971
16226
  }
15972
- function td(e) {
16227
+ function ad(e) {
15973
16228
  let { tenant: t, apiUrl: n, revision: r, locale: i } = o(Z), a = o(ar)?.[e], [c, l] = d(null);
15974
16229
  return s(() => {
15975
16230
  if (!e || a) return;
@@ -15992,11 +16247,11 @@ function td(e) {
15992
16247
  a
15993
16248
  ]), e ? a ?? c : null;
15994
16249
  }
15995
- var nd = (e, t, n) => t === "@card" ? n?.entry ? [n.entry] : [] : t ? e.filter((e) => e?.id === t || e?.data?.slug === t || e?.slug === t) : e, rd = (e, t) => ({
16250
+ var od = (e, t, n) => t === "@card" ? n?.entry ? [n.entry] : [] : t ? e.filter((e) => e?.id === t || e?.data?.slug === t || e?.slug === t) : e, sd = (e, t) => ({
15996
16251
  display: "grid",
15997
16252
  gridTemplateColumns: `repeat(${Math.min(Math.max(Number(e) || 4, 1), 8)}, minmax(0, 1fr))`,
15998
16253
  gap: t === "" || t == null || !Number.isFinite(Number(t)) ? 12 : Math.max(0, Number(t))
15999
- }), id = (e) => ({
16254
+ }), cd = (e) => ({
16000
16255
  loop: e.loop !== !1,
16001
16256
  caption: e.caption !== !1,
16002
16257
  counter: e.counter !== !1,
@@ -16004,7 +16259,7 @@ var nd = (e, t, n) => t === "@card" ? n?.entry ? [n.entry] : [] : t ? e.filter((
16004
16259
  autoplay: e.autoplay !== !1,
16005
16260
  backdrop: e.backdrop || "",
16006
16261
  color: e.color || ""
16007
- }), ad = {
16262
+ }), ld = {
16008
16263
  en: {
16009
16264
  all: "All",
16010
16265
  prev: "Previous page",
@@ -16019,7 +16274,7 @@ var nd = (e, t, n) => t === "@card" ? n?.entry ? [n.entry] : [] : t ? e.filter((
16019
16274
  page: (e) => `${e}. sayfa`,
16020
16275
  count: (e) => `${e} görsel`
16021
16276
  }
16022
- }, od = (e) => ad[String(e ?? "").slice(0, 2)] ?? ad.en, sd = (e) => ({
16277
+ }, ud = (e) => ld[String(e ?? "").slice(0, 2)] ?? ld.en, dd = (e) => ({
16023
16278
  padding: "7px 14px",
16024
16279
  borderRadius: 999,
16025
16280
  cursor: "pointer",
@@ -16029,8 +16284,8 @@ var nd = (e, t, n) => t === "@card" ? n?.entry ? [n.entry] : [] : t ? e.filter((
16029
16284
  background: e ? "var(--page-accent, #4f46e5)" : "transparent",
16030
16285
  color: e ? "var(--page-accent-text, #ffffff)" : "inherit"
16031
16286
  });
16032
- function cd(e) {
16033
- let { items: t = [], source: n = "", entry: r = "", mediaField: i = "", nameField: a = "", posterField: s = "", limit: c = 0, emptyText: l = "", columns: u = 4, gap: f = "", whereField: p = "", whereValue: _ = "", filterField: v = "", allLabel: y = "", perPage: b = 0, sortBy: x = "", sortDir: S = "asc", templateId: C, renderTemplate: w, style: T, nodeRef: E, inert: D } = e, { locale: O } = o(Z), k = o(lr), A = o(ur), j = td(n), [M, N] = d(""), [P, F] = d(0), I = od(O), L = n ? nd(j ?? [], r, A) : null, R = L && p && String(_ ?? "").trim() ? L.filter((e) => br(vr(e?.data, p)) === String(_).trim()) : L, z = Bu(Ku({
16287
+ function fd(e) {
16288
+ let { items: t = [], source: n = "", entry: r = "", mediaField: i = "", nameField: a = "", posterField: s = "", limit: c = 0, emptyText: l = "", columns: u = 4, gap: f = "", whereField: p = "", whereValue: _ = "", filterField: v = "", allLabel: y = "", perPage: b = 0, sortBy: x = "", sortDir: S = "asc", templateId: C, renderTemplate: w, style: T, nodeRef: E, inert: D } = e, { locale: O } = o(Z), k = o(lr), A = o(ur), j = ad(n), [M, N] = d(""), [P, F] = d(0), I = ud(O), L = n ? od(j ?? [], r, A) : null, R = L && p && String(_ ?? "").trim() ? L.filter((e) => br(vr(e?.data, p)) === String(_).trim()) : L, z = Wu(Xu({
16034
16289
  items: t,
16035
16290
  entries: R && x ? qa(R, x, S, O) : R,
16036
16291
  mediaField: i,
@@ -16039,22 +16294,22 @@ function cd(e) {
16039
16294
  }), c), B = (e) => v && e.entry ? br(vr(e.entry?.data ?? e.entry, v)) : "", V = v ? [...new Set(z.map(B).filter(Boolean))] : [], H = V.includes(M) ? M : "", U = (H ? z.filter((e) => B(e) === H) : z).map((e, t) => ({
16040
16295
  ...e,
16041
16296
  index: t + 1
16042
- })), W = Math.max(0, Number(b) || 0), G = W ? Math.max(1, Math.ceil(U.length / W)) : 1, K = Math.min(P, G - 1), q = W ? U.slice(K * W, (K + 1) * W) : U, { open: ee, overlay: te } = $u(U, id(e), O), J = w ?? (C && k?.render ? (e) => k.render(C, e) : null), ne = !!n && j === null, re = V.length > 1 || G > 1, ie = (e) => {
16297
+ })), W = Math.max(0, Number(b) || 0), G = W ? Math.max(1, Math.ceil(U.length / W)) : 1, K = Math.min(P, G - 1), q = W ? U.slice(K * W, (K + 1) * W) : U, { open: ee, overlay: te } = rd(U, cd(e), O), J = w ?? (C && k?.render ? (e) => k.render(C, e) : null), ne = !!n && j === null, re = V.length > 1 || G > 1, ie = (e) => {
16043
16298
  N(e), F(0);
16044
16299
  }, ae = /* @__PURE__ */ g("div", {
16045
16300
  ref: re ? void 0 : E,
16046
16301
  ...Q("grid"),
16047
16302
  style: {
16048
16303
  width: "100%",
16049
- ...rd(u, f),
16304
+ ...sd(u, f),
16050
16305
  ...re ? null : Y(T)
16051
16306
  },
16052
16307
  children: [
16053
16308
  q.map((t) => {
16054
- let n = qu(t);
16309
+ let n = Zu(t);
16055
16310
  return /* @__PURE__ */ h("div", {
16056
- ...Q("item", Vu(t.kind) && "item-video"),
16057
- ...D ? null : ed(() => ee(t.index - 1), n.data.name, O),
16311
+ ...Q("item", Gu(t.kind) && "item-video"),
16312
+ ...D ? null : id(() => ee(t.index - 1), n.data.name, O),
16058
16313
  style: {
16059
16314
  minWidth: 0,
16060
16315
  position: "relative",
@@ -16066,7 +16321,7 @@ function cd(e) {
16066
16321
  entry: n
16067
16322
  },
16068
16323
  children: J((e) => Or(e, n, O))
16069
- }), e.playMark !== !1 && Vu(t.kind) && /* @__PURE__ */ h(Yu, {})] }) : /* @__PURE__ */ h(Ju, { item: t })
16324
+ }), e.playMark !== !1 && Gu(t.kind) && /* @__PURE__ */ h($u, {})] }) : /* @__PURE__ */ h(Qu, { item: t })
16070
16325
  }, `${t.index}-${t.src}`);
16071
16326
  }),
16072
16327
  !U.length && !ne && (n ? l : null) && /* @__PURE__ */ h("div", {
@@ -16105,7 +16360,7 @@ function cd(e) {
16105
16360
  "aria-pressed": H === e,
16106
16361
  ...Q("filter", H === e && "filter-active"),
16107
16362
  onClick: () => ie(e),
16108
- style: sd(H === e),
16363
+ style: dd(H === e),
16109
16364
  children: e || y || I.all
16110
16365
  }, e || "__all"))
16111
16366
  }),
@@ -16127,7 +16382,7 @@ function cd(e) {
16127
16382
  disabled: K === 0,
16128
16383
  "aria-label": I.prev,
16129
16384
  onClick: () => F(K - 1),
16130
- style: sd(!1),
16385
+ style: dd(!1),
16131
16386
  children: "←"
16132
16387
  }),
16133
16388
  Array.from({ length: G }, (e, t) => /* @__PURE__ */ h("button", {
@@ -16136,7 +16391,7 @@ function cd(e) {
16136
16391
  "aria-current": t === K ? "page" : void 0,
16137
16392
  ...Q("page", t === K && "page-active"),
16138
16393
  onClick: () => F(t),
16139
- style: sd(t === K),
16394
+ style: dd(t === K),
16140
16395
  children: t + 1
16141
16396
  }, t)),
16142
16397
  /* @__PURE__ */ h("button", {
@@ -16145,7 +16400,7 @@ function cd(e) {
16145
16400
  disabled: K === G - 1,
16146
16401
  "aria-label": I.next,
16147
16402
  onClick: () => F(K + 1),
16148
- style: sd(!1),
16403
+ style: dd(!1),
16149
16404
  children: "→"
16150
16405
  }),
16151
16406
  /* @__PURE__ */ h("span", {
@@ -16163,48 +16418,48 @@ function cd(e) {
16163
16418
  ]
16164
16419
  }) : ae;
16165
16420
  }
16166
- var ld = { LightboxGallery: cd }, ud = /* @__PURE__ */ new Map();
16167
- function dd(e) {
16168
- if (ud.has(e)) return ud.get(e);
16421
+ var pd = { LightboxGallery: fd }, md = /* @__PURE__ */ new Map();
16422
+ function hd(e) {
16423
+ if (md.has(e)) return md.get(e);
16169
16424
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
16170
16425
  /* @vite-ignore */
16171
16426
  /* webpackIgnore: true */
16172
16427
  t
16173
16428
  ).finally(() => URL.revokeObjectURL(t));
16174
- return ud.set(e, n), n;
16429
+ return md.set(e, n), n;
16175
16430
  }
16176
- function fd({ apiUrl: e, tenant: t, id: n, version: r }) {
16431
+ function gd({ apiUrl: e, tenant: t, id: n, version: r }) {
16177
16432
  let i = new URLSearchParams({
16178
16433
  ...t ? { tenant: t } : {},
16179
16434
  ...r ? { v: r } : {}
16180
16435
  }), a = `${e}/plugins/${encodeURIComponent(n)}/code.js?${i}`;
16181
- if (ud.has(a)) return ud.get(a);
16436
+ if (md.has(a)) return md.get(a);
16182
16437
  let o = import(
16183
16438
  /* @vite-ignore */
16184
16439
  /* webpackIgnore: true */
16185
16440
  a
16186
16441
  );
16187
- return o.catch(() => ud.delete(a)), ud.set(a, o), o;
16442
+ return o.catch(() => md.delete(a)), md.set(a, o), o;
16188
16443
  }
16189
- function pd(e) {
16444
+ function _d(e) {
16190
16445
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
16191
16446
  return n && typeof n == "object" ? n : {};
16192
16447
  }
16193
16448
  //#endregion
16194
16449
  //#region ../ui/src/components/builder/plugins/view.jsx
16195
- async function md(e, t, n) {
16196
- let r = e.code ? await dd(e.code) : await fd(t);
16450
+ async function vd(e, t, n) {
16451
+ let r = e.code ? await hd(e.code) : await gd(t);
16197
16452
  return (Array.isArray(r?.default?.blocks) ? r.default.blocks : []).find((e) => e?.id === n && typeof e.mount == "function") ?? null;
16198
16453
  }
16199
- var hd = {
16454
+ var yd = {
16200
16455
  padding: "10px 12px",
16201
16456
  border: "1px dashed rgba(148, 163, 184, 0.5)",
16202
16457
  borderRadius: 8,
16203
16458
  fontSize: 12,
16204
16459
  opacity: .6
16205
16460
  };
16206
- function gd({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
16207
- let a = o(Z), c = pd(a?.settings)[e], l = u(null), d = u(null), f = {
16461
+ function bd({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
16462
+ let a = o(Z), c = _d(a?.settings)[e], l = u(null), d = u(null), f = {
16208
16463
  tenant: a?.tenant ?? "",
16209
16464
  apiUrl: a?.apiUrl ?? "/api",
16210
16465
  locale: a?.locale ?? "",
@@ -16216,7 +16471,7 @@ function gd({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
16216
16471
  let n = l.current;
16217
16472
  if (!c || !(c.code || c.version) || !n) return;
16218
16473
  let r = !0;
16219
- return md(c, {
16474
+ return vd(c, {
16220
16475
  apiUrl: p.current.apiUrl,
16221
16476
  tenant: p.current.tenant,
16222
16477
  id: e,
@@ -16256,7 +16511,7 @@ function gd({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
16256
16511
  }) : /* @__PURE__ */ g("div", {
16257
16512
  ref: i,
16258
16513
  style: {
16259
- ...hd,
16514
+ ...yd,
16260
16515
  ...Y(r)
16261
16516
  },
16262
16517
  children: [
@@ -16268,7 +16523,7 @@ function gd({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
16268
16523
  }
16269
16524
  //#endregion
16270
16525
  //#region ../ui/src/components/builder/render.jsx
16271
- function _d(e, t, n) {
16526
+ function xd(e, t, n) {
16272
16527
  let r = { "data-wb": e };
16273
16528
  t.htmlId && (r.id = t.htmlId), n && n.id === e && (r.id = t.htmlId || n.htmlId, r.tabIndex = -1);
16274
16529
  let i = ue(t.classNames);
@@ -16284,7 +16539,7 @@ function _d(e, t, n) {
16284
16539
  classes: i
16285
16540
  };
16286
16541
  }
16287
- function vd({ View: e, markup: n, ...r }) {
16542
+ function Sd({ View: e, markup: n, ...r }) {
16288
16543
  let a = e(r);
16289
16544
  if (!i(a) || typeof a.type != "string") return a;
16290
16545
  let o = [a.props.className, ...n.classes].filter(Boolean).join(" ");
@@ -16293,71 +16548,71 @@ function vd({ View: e, markup: n, ...r }) {
16293
16548
  ...o ? { className: o } : {}
16294
16549
  });
16295
16550
  }
16296
- var yd = /* @__PURE__ */ new Set([
16551
+ var Cd = /* @__PURE__ */ new Set([
16297
16552
  "FormInput",
16298
16553
  "FormTextarea",
16299
16554
  "FormSelect"
16300
16555
  ]);
16301
- function bd(e, t, n, r) {
16556
+ function wd(e, t, n, r) {
16302
16557
  if (t.forNode === "__none") return "";
16303
16558
  let i = t.forNode ? n[t.forNode] : null;
16304
16559
  if (!t.forNode) {
16305
16560
  let t = n[r]?.nodes ?? [];
16306
16561
  i = n[t[t.indexOf(e) + 1]] ?? null;
16307
16562
  }
16308
- return !i || !yd.has(i.type?.resolvedName) ? "" : i.props?.htmlId || Ia(i.props?.name) || "";
16309
- }
16310
- var xd = "slot-", Sd = {
16311
- ...ys,
16312
- ...Al,
16313
- ...fu,
16314
- ...ju,
16315
- ...ld,
16316
- PluginBlock: gd
16563
+ return !i || !Cd.has(i.type?.resolvedName) ? "" : i.props?.htmlId || Ia(i.props?.name) || "";
16564
+ }
16565
+ var Td = "slot-", Ed = {
16566
+ ...Cs,
16567
+ ...Pl,
16568
+ ...gu,
16569
+ ...Fu,
16570
+ ...pd,
16571
+ PluginBlock: bd
16317
16572
  };
16318
- function Cd(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
16573
+ function Dd(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
16319
16574
  let o = n[t];
16320
16575
  if (!o || o.hidden) return null;
16321
16576
  let s = o.type?.resolvedName, c = Ke(o.props ?? {}, a?.elementDefaults?.[s]), l = a?.mapProps ? a.mapProps(c, s) : c;
16322
16577
  if (s === "ComponentInstance") {
16323
16578
  let s = o.props?.componentId, c = r?.[s];
16324
16579
  if (!c?.template || i.has(s)) return null;
16325
- let u = new Set(i).add(s), d = Object.fromEntries(Object.entries(o.linkedNodes ?? {}).filter(([e]) => e.startsWith(xd)).map(([e, t]) => [e.slice(5), Cd(t, n, r, i, a)]));
16326
- return /* @__PURE__ */ h(e, { children: Cd(c.template.rootId, c.template.nodes, r, u, {
16580
+ let u = new Set(i).add(s), d = Object.fromEntries(Object.entries(o.linkedNodes ?? {}).filter(([e]) => e.startsWith(Td)).map(([e, t]) => [e.slice(5), Dd(t, n, r, i, a)]));
16581
+ return /* @__PURE__ */ h(e, { children: Dd(c.template.rootId, c.template.nodes, r, u, {
16327
16582
  ...Vt(l.values, a),
16328
16583
  slots: d
16329
16584
  }) }, t);
16330
16585
  }
16331
- let u = Sd[s];
16586
+ let u = Ed[s];
16332
16587
  if (!u) return null;
16333
- let d = l.compSlot?.id, f = d && a?.slots && Object.hasOwn(a.slots, d) ? a.slots[d] : void 0, p = f === void 0 ? (o.nodes ?? []).map((e) => Cd(e, n, r, i, a)).filter(Boolean) : [f].filter(Boolean), m = Object.entries(o.linkedNodes ?? {}), g = m.length ? Object.fromEntries(m.map(([e, t]) => [e, Cd(t, n, r, i, a)])) : void 0, _ = /* @__PURE__ */ h(typeof u == "function" ? vd : u, {
16588
+ let d = l.compSlot?.id, f = d && a?.slots && Object.hasOwn(a.slots, d) ? a.slots[d] : void 0, p = f === void 0 ? (o.nodes ?? []).map((e) => Dd(e, n, r, i, a)).filter(Boolean) : [f].filter(Boolean), m = Object.entries(o.linkedNodes ?? {}), g = m.length ? Object.fromEntries(m.map(([e, t]) => [e, Dd(t, n, r, i, a)])) : void 0, _ = /* @__PURE__ */ h(typeof u == "function" ? Sd : u, {
16334
16589
  ...typeof u == "function" ? {
16335
16590
  View: u,
16336
- markup: _d(t, l, a?.skipTarget)
16591
+ markup: xd(t, l, a?.skipTarget)
16337
16592
  } : null,
16338
16593
  ...l,
16339
16594
  ...s === "CollectionList" ? {
16340
16595
  templateId: o.linkedNodes?.card,
16341
- renderTemplate: o.linkedNodes?.card ? (e) => Cd(o.linkedNodes.card, n, r, i, {
16596
+ renderTemplate: o.linkedNodes?.card ? (e) => Dd(o.linkedNodes.card, n, r, i, {
16342
16597
  ...a,
16343
16598
  mapProps: a?.mapProps ? (t, n) => a.mapProps(e(t, n), n) : e
16344
16599
  }) : void 0
16345
16600
  } : null,
16346
- ...s === "LightboxGallery" && o.linkedNodes?.item ? { renderTemplate: (e) => Cd(o.linkedNodes.item, n, r, i, {
16601
+ ...s === "LightboxGallery" && o.linkedNodes?.item ? { renderTemplate: (e) => Dd(o.linkedNodes.item, n, r, i, {
16347
16602
  ...a,
16348
16603
  mapProps: a?.mapProps ? (t, n) => a.mapProps(e(t, n), n) : e
16349
16604
  }) } : null,
16350
- ...s === "TableBlock" && l.repeat ? { renderCell: (e, t) => o.linkedNodes?.[e] ? Cd(o.linkedNodes[e], n, r, i, {
16605
+ ...s === "TableBlock" && l.repeat ? { renderCell: (e, t) => o.linkedNodes?.[e] ? Dd(o.linkedNodes[e], n, r, i, {
16351
16606
  ...a,
16352
16607
  mapProps: a?.mapProps ? (e, n) => a.mapProps(t(e, n), n) : t
16353
16608
  }) : null } : null,
16354
- ...s === "FormLabel" ? { htmlFor: bd(t, l, n, o.parent) } : null,
16609
+ ...s === "FormLabel" ? { htmlFor: wd(t, l, n, o.parent) } : null,
16355
16610
  linked: g,
16356
16611
  nodeRef: (e) => {
16357
16612
  e && (e.setAttribute("data-wb", t), ve(e, l), a?.skipTarget?.id === t && (e.id = l.htmlId || a.skipTarget.htmlId, e.tabIndex = -1), _e(e, a?.events === !1 ? [] : l.events));
16358
16613
  },
16359
16614
  children: p.length ? p : void 0
16360
- }, t), v = l.when && l.when !== "always" ? /* @__PURE__ */ h(Ps, {
16615
+ }, t), v = l.when && l.when !== "always" ? /* @__PURE__ */ h(Rs, {
16361
16616
  when: l.when,
16362
16617
  children: _
16363
16618
  }, t) : _;
@@ -16368,9 +16623,9 @@ function Cd(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
16368
16623
  }
16369
16624
  //#endregion
16370
16625
  //#region ../ui/src/components/builder/PageRenderer.jsx
16371
- var wd = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Td = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ct(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
16626
+ var Od = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), kd = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ct(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
16372
16627
  .webim-page[data-webim-mode="dark"] { ${Object.entries(ct(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
16373
- function Ed({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: a, animations: o, tenant: c, apiUrl: d, datasets: f, locale: p, direction: _, settings: v, siteUser: y, param: b }) {
16628
+ function Ad({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: a, animations: o, tenant: c, apiUrl: d, datasets: f, locale: p, direction: _, settings: v, siteUser: y, param: b }) {
16374
16629
  let x = a?.js?.trim(), C = v && v["site.code"] && typeof v["site.code"] == "object" ? v["site.code"] : null, w = typeof C?.js == "string" ? C.js.trim() : "", E = typeof C?.css == "string" ? C.css.trim() : "";
16375
16630
  s(() => {
16376
16631
  if (!w) return;
@@ -16390,14 +16645,14 @@ function Ed({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
16390
16645
  minHeight: "100%",
16391
16646
  display: "flex",
16392
16647
  flexDirection: "column"
16393
- }, j = Nt(e, n), M = We(v), N = Cd("ROOT", e, n, void 0, {
16648
+ }, j = Nt(e, n), M = We(v), N = Dd("ROOT", e, n, void 0, {
16394
16649
  skipTarget: j || void 0,
16395
16650
  elementDefaults: M
16396
16651
  }), P = j ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("style", { children: Dt }), /* @__PURE__ */ h("a", {
16397
16652
  className: "webim-skip",
16398
16653
  href: `#${j.htmlId}`,
16399
16654
  children: wt(p || v?.locales?.default)("skip")
16400
- })] }) : null, F = l(() => ({ render: (t, r) => Cd(t, e, n, void 0, {
16655
+ })] }) : null, F = l(() => ({ render: (t, r) => Dd(t, e, n, void 0, {
16401
16656
  mapProps: r,
16402
16657
  elementDefaults: M
16403
16658
  }) }), [
@@ -16408,7 +16663,7 @@ function Ed({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
16408
16663
  rel: "stylesheet",
16409
16664
  precedence: "default",
16410
16665
  href: S(e)
16411
- }, e)), W = Td(B), G = pt(t);
16666
+ }, e)), W = kd(B), G = pt(t);
16412
16667
  return r === "auto" ? /* @__PURE__ */ h(Z.Provider, {
16413
16668
  value: {
16414
16669
  tenant: c || "",
@@ -16417,7 +16672,7 @@ function Ed({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
16417
16672
  settings: v ?? null,
16418
16673
  param: b || ""
16419
16674
  },
16420
- children: /* @__PURE__ */ h(Ns, {
16675
+ children: /* @__PURE__ */ h(Ls, {
16421
16676
  initialUser: y,
16422
16677
  children: /* @__PURE__ */ h(ar.Provider, {
16423
16678
  value: f ?? null,
@@ -16434,8 +16689,8 @@ function Ed({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
16434
16689
  },
16435
16690
  children: [
16436
16691
  P,
16437
- /* @__PURE__ */ h("style", { children: `.webim-page { ${wd(ct(B.light))} }
16438
- @media (prefers-color-scheme: dark) { .webim-page { ${wd(ct(B.dark))} } }` }),
16692
+ /* @__PURE__ */ h("style", { children: `.webim-page { ${Od(ct(B.light))} }
16693
+ @media (prefers-color-scheme: dark) { .webim-page { ${Od(ct(B.dark))} } }` }),
16439
16694
  /* @__PURE__ */ h("style", { children: W }),
16440
16695
  U,
16441
16696
  /* @__PURE__ */ h("style", { children: k }),
@@ -16459,7 +16714,7 @@ function Ed({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
16459
16714
  settings: v ?? null,
16460
16715
  param: b || ""
16461
16716
  },
16462
- children: /* @__PURE__ */ h(Ns, {
16717
+ children: /* @__PURE__ */ h(Ls, {
16463
16718
  initialUser: y,
16464
16719
  children: /* @__PURE__ */ h(ar.Provider, {
16465
16720
  value: f ?? null,
@@ -16495,7 +16750,7 @@ function Ed({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
16495
16750
  }
16496
16751
  //#endregion
16497
16752
  //#region src/WebimContent.jsx
16498
- function Dd(e) {
16753
+ function jd(e) {
16499
16754
  let t = e?.apiUrl, n = e?.tenant, r = e?.slug;
16500
16755
  s(() => {
16501
16756
  if (typeof window > "u" || !r || !t || new URLSearchParams(window.location.search).has("preview") || navigator.doNotTrack === "1" || window.doNotTrack === "1") return;
@@ -16518,8 +16773,8 @@ function Dd(e) {
16518
16773
  r
16519
16774
  ]);
16520
16775
  }
16521
- function Od({ bundle: e, mode: t = "auto", style: n }) {
16522
- return Dd(e), e?.blocks?.ROOT ? /* @__PURE__ */ h(Ed, {
16776
+ function Md({ bundle: e, mode: t = "auto", style: n }) {
16777
+ return jd(e), e?.blocks?.ROOT ? /* @__PURE__ */ h(Ad, {
16523
16778
  blocks: e.blocks,
16524
16779
  theme: e.theme,
16525
16780
  components: e.components,
@@ -16538,7 +16793,7 @@ function Od({ bundle: e, mode: t = "auto", style: n }) {
16538
16793
  }
16539
16794
  //#endregion
16540
16795
  //#region src/WebimPage.jsx
16541
- function kd({ 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 }) {
16796
+ function Nd({ 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 }) {
16542
16797
  let [g, _] = d({ status: "loading" }), v = u({
16543
16798
  onLoad: p,
16544
16799
  onError: m
@@ -16575,11 +16830,11 @@ function kd({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, mo
16575
16830
  r,
16576
16831
  i,
16577
16832
  a
16578
- ]), g.status === "loading" ? l : g.status === "error" ? typeof f == "function" ? f(g.error) : f : /* @__PURE__ */ h(Od, {
16833
+ ]), g.status === "loading" ? l : g.status === "error" ? typeof f == "function" ? f(g.error) : f : /* @__PURE__ */ h(Md, {
16579
16834
  bundle: g.bundle,
16580
16835
  mode: o,
16581
16836
  style: c
16582
16837
  });
16583
16838
  }
16584
16839
  //#endregion
16585
- export { Ed as PageRenderer, Od as WebimContent, kd as WebimPage, xt as fetchPage, ii as renderRichContent, _t as resolveTheme };
16840
+ export { Ad as PageRenderer, Md as WebimContent, Nd as WebimPage, xt as fetchPage, ii as renderRichContent, _t as resolveTheme };